omputed:注意不能直接在photoList后面加参数,没效果(应该是vue不支持),应该以JavaScript闭包的形式:

computed: {
    photoList() {
        return function(value){
            var imgList = [];
            for(var i=0;i<value.length;i++){
                imgList.push({src: value[i]});
            }
            return imgList;
        }
    }
}

template

 <div>{{photoList(item.photo)}}</div>
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐