Vue+Webpack常见问题(持续更新)

常识

1.computed计算属性,使用的属性必需在data里面声明。

Vue+Webpack常见问题(持续更新)
computed: {
    canLogin: function(){
        //注意这里的依赖的属性必需在data里面声明
        return this.name && this.password;
    }
}
Vue+Webpack常见问题(持续更新)

Webpack问题

1.模块里面使用JSON.stringify和 typeof,报:Uncaught TypeError: Cannot assign to read only property 'exports' of #<Object>

解决方法:把.babelrc里的plugin "transform-runtime" 删掉, 重启运行 

Vue控件问题

1.VueI18n的messages设置无效问题

Vue+Webpack常见问题(持续更新)
//messages得单独写出来,不然会报[vue-i18n] Cannot translate the value of keypath “”. Use the value of keypath as default.
const messages = {
  'lang': path.i18n
}
const i18n = new VueI18n({
    locale: 'lang',
    messages
})

new Vue({
    .....
    i18n
})
Vue+Webpack常见问题(持续更新)

 

分类: 3.前端框架

本文转自 海角在眼前 博客园博客,原文链接:  http://www.cnblogs.com/lovesong/p/7218969.html ,如需转载请自行联系原作者

上一篇:深度强化学习之:模仿学习(imitation learning)


下一篇:基于浏览器的容器 Codetainer