Weex初试(基于安卓)

一、配置环境

  1. 配置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 
  1. 配置npm
    a package manager for javascript
npm -v
  1. 安装weex
    A framework for building Mobile cross-platform UI.
npm install weex-toolkit -g
  1. 安装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

二、运行项目

  1. 创建项目
weex create HelloWeex```
这时候会提示

? This command need to install weexpack. Install now? y/n```
输入y继续

  1. 接下来切换到程序目录把东西跑起来
cd HelloWeex
npm install
weex platform add android
weex run android

之后会自动打开网页
---待补充---

  1. 以安卓项目打开
    "HelloWeex\paltforms" 目录下有一个"android" project
    打开可运行

四、 编辑项目

  1. 通过js更新界面

  2. 安卓原生界面

  3. js与安卓界面交互
    附:

  4. weex build

  5. weex run dev

  6. weex run serve

你可能感兴趣的:(Weex初试(基于安卓))