weex 学习

相关资料和链接:

# 官方网站
https://weex.apache.org/cn/

# github
https://github.com/apache/incubator-weex

# weex环境搭建
https://weex.apache.org/cn/guide/set-up-env.html

 

搭建开发环境

第一步:安装依赖

注意: weex-toolkit 在 1.0.1 之后才支持初始化 Vue 项目,使用前请确认版本是否正确。

$ npm install -g weex-toolkit
$ weex -v
v1.0.3
weex-builder : v0.2.4
weex-previewer : v1.3.4

国内开发者可以考虑使用淘宝的 npm 镜像 —— cnpm 安装 weex-toolkit

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ cnpm install -g weex-toolkit

第二步:初始化

然后初始化 Weex 项目:

# 创建 Vue 和 Wexx 模板项目
$ weex init awesome-project

# 进入项目目录
$ cd awesome-project

# 安装依赖
$ npm install

之后分别执行 npm run dev 和 npm run serve 开启watch 模式和静态服务器。

然后我们打开浏览器,进入 http://localhost:8080/index.html 即可看到 weex h5 页面:

第三步:手机应用市场搜索并下载:weex Playground App.然后用 Playground 扫描二维码,感受 native 优秀的体验:

  

原文地址:https://www.cnblogs.com/CyLee/p/6627137.html