[Applet] knowledge

1, how to create a component applet

 

 

0.1, beginning when the file was created, utils inside app.json have a path, the path needs to get rid of

 

 

 0.2, first need to  json be custom component file statement (the  component field to  true the set of files can be set to custom components):

{
  "component": true
}

  

 

 0.3, the register assembly Component

 

 0.4, editing component

 

 

0.5, using components provided json document pages need to use them, as well the use wxml

 


 

 

2, communications between components and that the white page {value} pass

 0.1, page components to achieve transfer value?

Passed: By custom property value to the assembly, the denomination needs to be passed in the page
Receiving: properties within component js file to accept example: Component ({properties: {custom attribute {type: String}}})
 
 
E.g:

 

  

 

Guess you like

Origin www.cnblogs.com/yuanjili666/p/11671650.html