美文网首页
weex weex-ui的使用

weex weex-ui的使用

作者: 走停2015_iOS开发 | 来源:发表于2018-07-10 17:18 被阅读3238次

https://github.com/alibaba/weex-ui
重点需要: "style": false
安装前建议你的node版本是 >= 8.0, 推荐使用 n 来进行版本管理,同时建议 npm 版本 >= 5

node -v
v8.2.1
npm --version
5.3.0

确保weex-toolkit为新版本

npm install -g weex-toolkit@latest

创建项目

weex create your_project

cd到your_project的根目录,安装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文件如下

{
  "presets": ["es2015", "stage-0"],
  "plugins": [
    [
      "component",
      {
        "libraryName": "weex-ui",
        "libDir": "packages",
        "style": false
      }
    ]
  ]
}

OK,可以开始使用weex-ui了,使用方法参考https://alibaba.github.io/weex-ui/#/cn/

作者:jiabin87428
链接:https://www.jianshu.com/p/d97a58345cdf
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

相关文章

网友评论

      本文标题:weex weex-ui的使用

      本文链接:https://www.haomeiwen.com/subject/cglqpftx.html