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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容