Scene applets framework layer

(1) Framework

    Target small development framework is as simple as possible through efficient way for developers to develop native APP service experience in micro letter.

    Applets entire frame system is divided into two parts: the logical layer (App Service) and the  view layer (View). Applet provides its own view layer description language  WXML and  WXSS, based on  JavaScript the logical layer framework, and provides a data transmission system between the event and view layer and logical layer, allowing developers to focus on data and logic.

 

Data (2) in response to a binding

The core framework is a response data binding system, allowing data to view very simply to keep pace. Time as data modification, only need to modify the data at the logical level, the view layer will be updated accordingly.

<!-- This is our View -->
<view> Hello {{name}}! </view>
<button bindtap="changeName"> Click me! </button>
// This is our App Service.
// This is our data.
var helloData = {
  name: 'WeChat'
}

// Register a Page.
Page({
  data: helloData,
  changeName: function(e) {
    // sent data change to view
    this.setData({
      name: 'MINA'
    })
  }
})
  • The developer layer data through a logical framework for  name the view layer  name is bound, it will be displayed on the page when opened  Hello WeChat!;
  • When clicks on the button, the view layer sends  changeName an event to the logic layer, the logic layer events to find and execute the corresponding processing function;
  • Callback function triggers, executive logic layer  setData operations will  data in  name the  WeChat changes  MINA, because the data has been bound and the view layer, thus automatically changed to the view layer  Hello MINA!.

 

(3) page management
    framework for managing the entire route page applets, can be done seamlessly switch between pages and pages give complete lifecycle. Developers need to do is page data, methods, life cycle functions registered to the framework, all other operations are handed over to the complex process framework.

 

(4) the base component
    framework provides a set of basic components that comes with the micro-channel pattern and style special logic, developers by combining base assembly, creating a strong microcells applet.

 

(5) rich API
    framework provides a rich API of native micro-channel, it can be easily adjusted from the ability to provide a micro-channel, user information such as access, local storage, payment functions.

 

 

.

Guess you like

Origin www.cnblogs.com/jianxian/p/11100315.html