"Applet" parent components pass data to the subassembly

The first step: to establish assembly. To ensure that the components up and running properly. Sub-assembly is normally introduced

 

Step Two: In the parent page to define the data in a set of data

Example:

Data: { 
    ARR: [ 'tiezhu', 99, 'M'] 
},

 

The third step: transmitting the data in the parent page

Example:

<v-children
  arrs='{{arr}}'>
</v-children>

 

Step Four: receiving data sub-assembly, in written json

properties: {
      arrs:{
        type:Array,
        value:[]
      }
  },

 

A fifth step, the data operation subassembly WXML

<view wx:for='{{arrs}}' wx:key='{{index}}'>{{item}}</view>

 

Guess you like

Origin www.cnblogs.com/yetiezhu/p/12631793.html