问题解决了: 使用 weexpack create 项目名
创建项目即可,不要使用官方文档中的 weex create 项目名
!!!
使用 weex 创建项目,引入 weex-ui,复制 weex-ui 的 demo 代码,运行后浏览器控制台报错:
[Vue warn]: Property or method "_px2rem" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
found in
---> <WxcButton> at /Users/xuyuning/Sites/myApp/node_modules/weex-ui/packages/wxc-button/index.vue
<HelloWorld> at /Users/xuyuning/Sites/myApp/src/components/HelloWorld.vue
<Root>
看上去是 _px2rem
这个包调用失败,而这个 WxcButton
是在 node_modules/
中的,没有修改权限。
有遇到类似问题的同学吗??求解!!!
我调用正常, 你检查一下weexpack版本