Hello Weex

run

  1. The environment
    1. Installation Node. Js 4.0 +
    2. In the root directory
      1. npm install, Installation works
      2. ./startAt this point the Web version is up and running, browser typehttp://localhost:12580/You can see it.
    3. Install iOS Environment
    4. Install CocoaPods
  2. Running iOS playground
    1. cd ios/playground
    2. pod install
    3. Open it in XcodeWeexDemo.xcworkspace
    4. Click on the Xcode (RunButton) or use shortcut keyscmd + r
    5. If you want to run it on a real machine. inDemoDefine.h, modifyCURRENT_IPFor your own IP

Weex App: Monkey for GitHub

Monkey is mainly used to show developer rankings on GitHub, as well as warehouse rankings.

WeexiOSKit

WeexiOSKit extends iOS components and modules so that they can be used in weeX.

Component Included segmented- Control (UISegmentedControl), Stepper (UIStepper), Seek-bar (UISeekBar), Search-bar (UISearchBar),date-picker (UIDat) EPicker).

Module includes actionSheet (UIActionSheet), MBProgressHUD (MBProgressHUD, loading view), geolocation (CLLocationManager coordinates), Vibration.

Module

WeexiOSKit use

Module

MBProgressHUD is the loading module function: ShowHUD (display HUD, title, detail, mode[indicator/text], cancelTitle, contentColor), hideHUD hideHUD ()

toast: function() { var MBProgressHUD = require('@weex-module/MBProgressHUD'); MBProgressHUD.showHUD({title:"loading",contentColor:"red",mode:"indicator"}); setTimeout(function () { MBProgressHUD.hideHUD(); }}, 2000),Copy the code

ActionSheet function: actionSheetShow (arguments are cancelButtonTitle, destructiveButtonTitle, otherButtonTitles (array), and a callback)

      actionSheet: function() {
        var me= this;
        var actionSheet = require('@weex-module/actionSheet');
        actionSheet.actionSheetShow({
          'cancelButtonTitle': 'cancel',
          'destructiveButtonTitle': 'destructive',
          'otherButtonTitles': me.buttons
        }, function(result) {
        });
      },


Copy the code

Geolocation locates a module

Function getCurrentPosition (Parameter Accuracy, distanceFilter)

      geolocationAction: function() {
        var me= this;
        var geolocation = require('@weex-module/geolocation');
        geolocation.getCurrentPosition({
          'accuracy': '1000',
          'distanceFilter': '10'
        }, function(result) {
          me.geolocationValue = JSON.stringify(result);
        }, function(result) {
        });
      },

Copy the code

Vibration function: Vibrate

      vibrate: function() {
        var vibration = require('@weex-module/vibration');
        vibration.vibrate()
      }

Copy the code

Licenses

All source code is licensed under the MIT License.

Welcome to join the Weex study group and learn Weex together!