weex初始化和填坑(android)

開發環境搭建(Android)

1. 下載JDK

配置環境變量

2. Android Studio開發環境

搭建相關

sync緩慢 || https->http

// build.gradle
buildscript {
    
    repositories {
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
}

3. 連接手機

app啓動頁,圖標設置

4. 模擬路由守衛
5. 正常引入vuex

報錯 找不到模塊?

原因是store.js有vue的內容,經查證,引入vue的時候不能用相對地址,參考其他的模塊引入

import store from  '@/store'
6. weex裏Vuex state使用storage持久化
7. 對於async、await等支持
//命令行安裝
npm install --save-dev babel-plugin-transform-runtime

//然後在.babelrc文件中加入
{
"presets": [
"es2015",
"stage-0"
],
"plugins": [ [
"transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
}
]]
}
8. 基於 weex 封裝、面向前端的 vue 寫法的一整套 APP 開源解決方案

eros

eros init
cd 包名
npm install

eros dev

用git bash執行安裝依賴 install.sh

再打開 AS

9. 調試
  1. app 上關閉 攔截器
  2. 開啓熱更新
  3. eros dev
  4. weex debug
  5. 掃碼
  6. 開啓js調試.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章