初次使用weex-ui控件后,编译报错:
ERR! [webpack errors]./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/index.vue
Module not found: Error: Can’t resolve ‘weex-ui/packages/wxc-button/style.css’ in ‘/Users/lhuihuiy/Desktop/project/abc/src’
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/index.vue 7:0-48
@ ./src/index.vue
@ ./.temp/entry.js
在这里插入图片描述
解决方法:
1》、npm i babel-preset-stage-0 babel-plugin-component -D 安装这两个插件
2》、修改.babelrc文件代码为:
{
“presets”: [“es2015”, “stage-0”],
“plugins”: [
[
“component”,
{
“libraryName”: “weex-ui”,
“libDir”: “packages”,
“style”: false
}
]
]
}
重新运行项目
---------------------