常识

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

computed: {
    canLogin: function(){
        //注意这里的依赖的属性必需在data里面声明
        return this.name && this.password;
    }
}

Webpack问题

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

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

Vue控件问题

1.VueI18n的messages设置无效问题

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-06-04
  • 2022-02-16
  • 2021-08-13
  • 2022-12-23
  • 2021-12-28
猜你喜欢
  • 2021-11-28
  • 2021-05-11
  • 2021-12-19
  • 2021-11-17
  • 2021-09-16
  • 2021-11-25
  • 2022-12-23
相关资源
相似解决方案