Vue插件

vue-lazyload 图片懒加载

import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
    loading:"/static/loading-svg/loading-bars.svg"
})

<img v-lazy="图片名称">

vue-infinite-scroll 滚动刷新

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);
    }
}

vue-meta 设置页面meta

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"
   })
]

better-scroll

circle-progress

posted @ 2018-08-23 09:39  conglvse  阅读(141)  评论(0编辑  收藏  举报