我想直接通过vue循环一个列表,基本实现vue循环,只是data-original这个属性我也想通过vue数组循环出来。下面是HTML代码{{item.pi}}{{item.ln}}{{item.pa}}这是vue代码varprojectObject=[{"rs":"entertop","pi":"网络管理事业部","iname":"../images/slt1.png","di":"mobile","dp":'',"dda":"file/mobile/testMobile.rar","ln":"性能日报","pa":"越程程"}];newVue({el:'#projectCon',data:{projectObject}});这个要怎么做呢?能不能属性通过循环展示
2 回答
qq_笑_17
TA贡献1818条经验 获得超7个赞
vue实例化时加了如下代码循环添加属性vardtOriginalArray=[{"oriArray":["../uiImage/psd1OriginalImage1.png","../uiImage/psd1OriginalImage2.png","../uiImage/psd1OriginalImage3.png"]},{"oriArray":["../uiImage/psd2OriginalImage1.png","../uiImage/psd2OriginalImage2.png","../uiImage/psd2OriginalImage3.png","../uiImage/psd2OriginalImage4.png","../uiImage/psd2OriginalImage5.png","../uiImage/psd2OriginalImage6.png","../uiImage/psd2OriginalImage7.png"]}];computed:{getOriginUrl:function(index){vararr=[];for(vari=0;iarr.push(dtOriginalArray[i]['oriArray']); }returnarr}}感谢wmui的解答
添加回答
举报
0/150
提交
取消