今日总结:vue 图片懒加载 与push使用

import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
	error:require('./assets/error.png'),
	loading:require('./assets/loading.png')
})

//引入     npm install vue-lazyload --save-dev

v-lazy='"http://jujiewang.oss-cn-hangzhou.aliyuncs.com/"+site.logo' 

//使用

//得到数据 push 的时候不能直接把对象放进去,要一个个for循环

                    var pushList=response.respond;
                    for (let i = 0; i < 10; i++) {
                          that.data.push(pushList[i]);
                     }
                              },

猜你喜欢

转载自blog.csdn.net/qq_38674970/article/details/81135247