一、配置環(huán)境
- 配置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
二凉唐、運行項目
- 創(chuàng)建項目
weex create HelloWeex```
這時候會提示
? This command need to install weexpack. Install now? y/n```
輸入y繼續(xù)
- 接下來切換到程序目錄把東西跑起來
cd HelloWeex
npm install
weex platform add android
weex run android
之后會自動打開網(wǎng)頁
---待補充---
- 以安卓項目打開
"HelloWeex\paltforms" 目錄下有一個"android" project
打開可運行
四极颓、 編輯項目
通過js更新界面
安卓原生界面
js與安卓界面交互
附:weex build
weex run dev
weex run serve