weex-demo-dusan

2018最新weex开发实战-附android集成demos_第1张图片 weex-android-demos.jpeg

更新:2018年新增了android工程,weex demos。

weex开源以来,很多人关注,写了一些weex小案例,仅供参考。可以学习weex原理和应用,跨平台应用的特定语法,前端框架,webpack,vue.js,android集成weex,以及weex调试等。

项目github地址,直接看效果:star,fork一下吧!

https://github.com/duqian291902259/weex-demo-dusan

How to start

This demo is based on weex.
so,you must install the environment of weex .
A framework for building Mobile cross-platform UI: https://github.com/apache/incubator-weex

先安装好weex的各种脚手架工具。再按照以下说明运行本项目demo。

About 项目说明:

weex-android-demo

基于weex sdk及官方demo,使用vue写weex页面,web和android端测试渲染效果,新增了多个实例demo,js来自weex-demo编译打包后的js bundle文件,放在assets目录里面。更新如下:

1,多WXSDKInstance实现子页面。
2,从android asset目录,网络加载weex js。
3,Native和Weex页面交互。
4,拓展原生module,图片加载,Toast,相互通信等。
5,使用Vue重写以前的demo,测试新的weex-ui组件。

weex-demo

使用最近的weex版本,用vue.js开发的一些demo,测试常用的一些场景。配合weex-android-demo使用。


2018最新weex开发实战-附android集成demos_第2张图片 weex-demo-index.png

以下是前端开发常用命令:

npm install

install all dependencies, weex-ui.
进入你本地weex-demo根目录,安装所有依赖包,本项目使用了weex-ui,也一并安装。

cd /path/to/weex-demo npm installnpm i weex-ui -S

install babel-preset-stage-0
为了不打包所有的组件,你需要使用 babel-plugin-component 来只引入需要的组件打包。

npm i babel-preset-stage-0 babel-plugin-component  -D

npm start

Starts the development server for you to preview your weex page on browser.
You can also scan the QR code using weex playground to preview weex page on native.

npm run build

build src with webpack.Packaging html5 project into /dist folder.

npm run dev

Open the code compilation task in watch mode.

npm run serve

Starts local server for develop weex page:
Project is running at local server,like http://192.168.0.68:8081/

preview your page:
1, http://192.168.0.68:8081/web/index.html?page=/dist/web/index.js

the dist file:
2, http://192.168.0.68:8081/dist/index.js

以上ip改为你本地的ip地址,预览使用第一个地址。Native加载网络js可以用第二个地址。dist目录里面生成的xxx.js文件,可以放在assets目录中加载。

weex2016

weex2016,基于weex早期版本,依然适用,但建议移步最新的官方文档。以最新的语法和sdk为准。

Future

demo虽小,五脏俱全,weex三端统一,write once,run everywhere,sdk逐步完善,满足各种场景的展示,交互,动画等需求,值得研究和应用。

早期相关博文:

1,Weex开源测试之环境搭建,weex未来展望

2,Weex开发笔记

Thanks to weex team!

Weex,We will follow you!

更多相关文章

  1. appium 并发测试
  2. android Activity加载完成后的监听事件
  3. 关于android示例程序(bitmapfun)——高效加载图片的坑爹地方
  4. 安卓 WebView加载本地图片时居中显示
  5. Android中ViewPager+Fragment取消(禁止)预加载延迟加载(懒加载)
  6. Android design support library 通过gradle加载
  7. Android SDK中的自动化测试

随机推荐

  1. 在配置最新Androi adt20.0.0 遇到的一些
  2. CSS3实现android(安卓)Logo图标效果
  3. Qt 实现android camera摄像头的preview和
  4. android检测网络是否正常
  5. android UI设计属性中英对照表(未修订)
  6. Android(安卓)Settings中的默认设置
  7. Android(安卓)源码分析鼠标事件传递
  8. Android(安卓)数据共享标准:ContentProvid
  9. android模拟器创建报错: PANIC: Could not
  10. Android(安卓)实现点击两次BACK键退出应