鍍金池/ 問答/HTML/ weex + weex UI : TypeError: _vm._px2rem

weex + weex UI : TypeError: _vm._px2rem is not a function

問題解決了: 使用 weexpack create 項目名 創(chuàng)建項目即可,不要使用官方文檔中的 weex create 項目名?。。?/strong>


使用 weex 創(chuàng)建項目,引入 weex-ui,復(fù)制 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 這個包調(diào)用失敗,而這個 WxcButton 是在 node_modules/ 中的,沒有修改權(quán)限。

有遇到類似問題的同學(xué)嗎??求解!??!

回答
編輯回答
初念

我調(diào)用正常, 你檢查一下weexpack版本

2018年4月25日 01:05