一、配置环境
- 配置node
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. The Node.js package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
node -v
- 配置npm
a package manager for javascript
npm -v
- 安装weex
A framework for building Mobile cross-platform UI.
npm install weex-toolkit -g
- 安装webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
npm install webpack -g
二、运行项目
- 创建项目
weex create HelloWeex```
这时候会提示
? This command need to install weexpack. Install now? y/n```
输入y继续
- 接下来切换到程序目录把东西跑起来
cd HelloWeex
npm install
weex platform add android
weex run android
之后会自动打开网页
---待补充---
- 以安卓项目打开
"HelloWeex\paltforms" 目录下有一个"android" project
打开可运行
四、 编辑项目
通过js更新界面
安卓原生界面
js与安卓界面交互
附:weex build
weex run dev
weex run serve