Skip to content

Introduction

The goal of the mini program development framework is to allow developers to develop services with native APP experience in the client in the simplest and most efficient way possible.

The entire mini program framework system is divided into two parts: the logic layer (App Service) and the rendering layer (View). The mini program provides its own rendering layer description language WXML and WXSS, as well as a logic layer framework based on JavaScript, and provides data transmission and event systems between the rendering layer and the logic layer, allowing developers to focus on data and logic.

Responsive data binding

The core of the framework is a responsive data binding system that allows data and views to be synchronized very easily. When modifying data, you only need to modify the data in the logic layer, and the rendering layer will be updated accordingly.

Let's take a look at this simple example:

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

// Register a Page.
Page({  
  data: helloData,  
  changeName: function(e) {    
    // sent data change to view    
    this.setData({      
      name: 'World'    
    })  
  }
})
  • The developer uses the framework to bind the name in the logic layer data to the name in the view layer, so Hello Luffa Cloud! will be displayed when the page is opened.
  • When the button is clicked, the view layer will send the changeName event to the logic layer, and the logic layer will find and execute the corresponding event processing function;
  • After the callback function is triggered, the logic layer executes the setData operation to change the name in the data from Luffa Cloud to World. Because the data is bound to the rendering layer, the rendering layer will automatically change to Hello World!

Page management

The framework manages the page routing of the entire mini program, which can achieve seamless switching between pages and give the page a complete life cycle. All developers need to do is register the page data, methods, and life cycle functions to the framework, and all other complex operations are handled by the framework.

Basic components

The framework provides a set of basic components, which come with unified styles and special logic. Developers can create powerful Luffa Cloud mini programs by combining basic components.

Rich APIs

The framework provides a rich set of native APIs, which can easily call up the capabilities provided by the mini program SDK, such as obtaining geographic location information, local storage, etc.