vue-lazyload 图片懒加载
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
loading:"/static/loading-svg/loading-bars.svg"
})
<img v-lazy="图片名称">
import infiniteScroll from 'vue-infinite-scroll'
Vue.use(infiniteScroll)
//busy为true,加载
<div class="loading-more" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="10" v-show="loading">加载中...</div>
data: {
busy: false
},
methods: {
loadMore: function() {
this.busy = true;
setTimeout(() => {
//加载数据
this.busy = false;
}, 1000);
}
}
import Meta from 'vue-meta'
Vue.use(Meta)
metaInfo() {
return {
meta: [
{ property: 'og:title', content: this.itemList.title },
]
}
}
jquery
import $ from 'jquery'
//webpack.base.conf.js
var webpack = require("webpack")
//在module.exports的最后加入
plugins: [
new webpack.optimize.CommonsChunkPlugin('common.js'),
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery"
})
]
circle-progress