https://github.com/alibaba/weex-ui
安裝前建議你的node版本是 >= 8.0, 推薦使用 n 來進(jìn)行版本管理,同時(shí)建議 npm 版本 >= 5
node -v
v8.2.1
npm --version
5.3.0
確保weex-toolkit為新版本
npm install -g weex-toolkit@latest
創(chuàng)建項(xiàng)目
weex create your_project
cd到y(tǒng)our_project的根目錄,安裝weex-ui
npm i weex-ui@latest -S
同樣,在項(xiàng)目根目錄下,安裝babel-preset-stage-0 和 babel-plugin-component 插件,前者用于babel編譯,后者用于優(yōu)化 weex-ui 包的組件引用
npm i babel-plugin-component babel-preset-stage-0 -D
修改項(xiàng)目下的.babelrc文件如下
{
"presets": ["es2015", "stage-0"],
"plugins": [
[
"component",
{
"libraryName": "weex-ui",
"libDir": "packages",
"style": false
}
]
]
}
OK,可以開始使用weex-ui了,使用方法參考https://alibaba.github.io/weex-ui/#/cn/