开发

作者: defer | 来源:发表于2018-03-25 12:47 被阅读0次

    方法只执行一次

    if (!this.abc) {

    func()

    this.abc = true

    }

    图片懒加载 lazyload 

    插件(vue-lazy-load)

    刷新路由相同的页面

    不改变路由参数 this.$router.go(0)

    改变路由参数 this.$router.push({path:'/index'}, () => {

        this.$router.go(0)

    })

    VScode 函数或文件注释

    /**回车

    /**

    *

    * @param {*} el

    */

    vue中使用第三方库

    1)全局变量 window._ = require('lodash') // 服务器端不可用

    2)在需要该库的文件中导入 import _ from 'lodash' 

    3) 原型上添加 import moment from 'moment'; Object.defineProperty(Vue.prototype, '$moment', {value: moment})

    4)写插件 

    没看懂2333

    相关文章

      网友评论

          本文标题:开发

          本文链接:https://www.haomeiwen.com/subject/inphcftx.html