initialising a global mixin in weex我使用 weex create awesome-project 初始化了一个 weex 和 vue 应用程序。在 entry.js 文件中,我试图注册一个全局 mix...
我使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import weex from 'weex-vue-render' import Vue from 'vue' Vue.mixin({ computed: { device () { return 'mobile' }, browser () { return this.device === 'browser' }, mobile () { return this.device === 'mobile' } } }) weex.init(Vue) |
没有一个组件有
仅供参考。好像我刚刚有一个损坏的 Weex 版本!如果你发现自己遇到了这个问题,只需更新 Weex,启动一个新项目并将所有代码移过来。对我来说就像一个魅力。