确保 weex-toolkit 为新版本
目前最新版本为:
weex -v
weex create your_project
同时安装相关依赖
在项目中使用 Weex Ui
安装 weex-ui
npm i weex-ui@latest -S
安装babel-preset-stage-0 和 babel-plugin-component 插件,前者用于babel编译,后者用于优化 weex-ui 包的组件引用
npm i babel-plugin-component babel-preset-stage-0 -D
同时修改.babelrc如下
检测是否可以正常运行
启动一个web服务器
可以看到如下:
测试下 weex 编译单文件
weex src/index.vue
weex platform add androidweex run android
测试下 iOS 编译和打包
Please feel free to use and contribute to the development.
原文: https://alibaba.github.io/weex-ui/#/cn/with-weex-toolkit