ucar-weex

Time:2019-11-14

Preface

ucar-weex

Environment building

Official website

1. weex-toolkit

2. node

3. weexpack

4. weextools

brew install node

npm install -g weex-toolkit
npm install -g weexpack
npm install -g weextools

Common commands for scaffolds
weextools:

Commands:

    create [name]         initialize a standard weex project
    platform [command]    command for add or remove a  platform project
    run [platform]        run weex app on the specific platform
    build [platform]      build weex app generator package(apk or ipa)
    install [platform]    install weex app to mobile
    plugin [command]      command for add,create,login,publish weex plugins
    weexplugin [command]  create a project that is a manager of plugin
    help [cmd]            display help for [cmd]

Project initialization

weex init demo
weexpack create demo1
weextools create demo2  

project

Official Demo: weex hackernews

ucar-weex

unscramble

Components - Vue components
Views -- Views
store ——Vuex
Mixins - extensions
Filters -- filter of vue.js
App.vue main UI
Entry.js entry program
router.js ——vue-router

2. ucar-weex

ucar-weex

WeexProject
  ├── dist
  Compile (JS file) directory
  |   └── views/index.js
  |   └── package
  |       └── ucar-weex_1_20170910101838.so
  |       └── ucar-weex_1_20170910101838.json
  ├── hooks
  │   └── README.md
  ├node_modules node dependency package
  ├ - package.json node configuration file
  ├ - platforms // platform template directory
  │   └── android
  │   └── ios
  ├ - plugins // plugin download directory
  │   └── README.md
  ├ - Src // business code (we file) directory
  │   └── views
  │       └── index.vue
  │       └── pageA.vue
  │   └── assets
  │       └── image/icon_back.png
  │       └── font/icon_font.ttf
  ├── tools
  │   └── android
  │   └── ios
  │   └── packzip.js
  │   └── webpack.config.plugin.js
  └ -- webpack.config.js // webpack compile script

2. UCAR weex Android integration

3. Weex integration UCAR weex

  • https://www.npmjs.com/package…

npm install ucar-weex --save
  1. UCAR weex basic API

Project commissioning

ucar-weex

npm run dev
weex debug

Package release

1. the first step

npm run packzip
  • ucar-weex_1_20170910101838.json
  • ucar-weex_1_20170910101838.so

2. second steps

npm run copy:android
  • .json |.so => android/assets

3. third steps

  • . JSON |. So = > publish to server

4. fourth steps

UWXResManager.getInstance().addWXResFromAssert(this, FileUtils.getWXPackageFileName(this,"weex"));
//        UWXResManager.getInstance().setServerUrl("");
        UWXResManager.getInstance().checkUpdate(new UWXResManager.CheckUpdateCallback() {
            @Override
            public void callback(int code, String msg, WXPackageInfo info) {
                Toast.makeText(WXApplication.this, msg, Toast.LENGTH_LONG).show();
                UWLog.d("WXApp", msg);
                //Restart prompt
            }
        });

Other

1. Plug in market

2. weexext

3. Weex Forum

Recommended Today

Mongodb quick start notes (2): mongodb concept and simple operation

Mongodb is a collection oriented document database, unlike relational databases, which have tables, columns, and rows. Mongodb databases are composed of a series of documents. Next, I will introduce the concept and simple operation of mongodb 1. The following are the simple concept differences between the general relational database and mongodb database: 2. Simple operation […]