1.安装node.js,使用node -v检查是否成功安装。
2.安装weex-toolkit,npm install -g weex-toolkit;
检查 weex -v
3.全局安装weexpack, npm install -g weexpack,用来插件的使用;
4.初始化项目weex create 项目名;
5.添加平台 weex add platform Android/ios;
6.配置jdk环境变量(java);JDK安装与环境变量配置_百度经验
7.安装Android-studio;
8.配置sdk环境变量(android-home)在windows10上配置Android的环境变量_百度经验
注:
1.修改APP名称在 Android-studio中res/strings.xml目录;图标res/mipmap;主题manifests;开头页字res/layout/activity_splash/....text
text在res/strings.xml(name = dummy_content)引用修改;
2.weex不支持百分数;
3.border设置分开写;
4.长度单位只支持px;(宽720px = 100%; 高1250px = 100%)
5.组件 ⑴最外层标签只能用div;
⑵css样式必须使用类名或者id;
⑶text:使用文本必须使用该标签,超出显示需要省略号可以使用 lines(lines:1>>>>显示一行其余省略);
⑷input:标签必须闭合,并且调试时使用模拟机预览;
6.a标签链接js文件(打包后);
7.长按时间:longpress;
屏幕内事件Appear:如果一个位于某个可滚动区域内的组件被绑定了appear事件,那么当这个组件状态变为屏幕内触发;
屏幕外时间Disappear:同上;
8.hash.history.abstract中只有abstract可以使用,router-link不能使用,需编程式导航;
<router-link>示例:
<template>
<div>
<router-link to='profile'>
<text>profile</text>
</router-link>
</div>
</template>
》》》》》》》》》》weex中不适用,只能使用编程式导航:
<template>
<div>
<text @click='jump'>Profile</text>
</div>
</template>
<script>
import router from './path/to/router'
export default{
methods:{
jump(){
router.push('profile')
}
}
}
</script>