one Basic operation
1. Create default components
Created using applets development tools to help quickly construct default files
2. Introduce the component path in the xxx.json file where the component is used (the parent component)
We can see in the page that the content of the child component was successfully introduced
two The data transfer
1. Parent component passes data to child component add data array tabs to parent component’s JS file []
2. Add a keyword for passing parameters to the parent component
3. The child component receives parameters in the properties of the JS file
4. The parent component assigns a click event to the child component’s label
The event fetch is the index of the current tabs[] array and determines whether it is selected or not.
5. The child component defines the output part, and circulates the data of the Tabs array in the data sent by the parent component through wX: for, and realizes the function of switching the parent component to listen and return the index value by binding the switch event bindtap. (To insert content, you need to set slot tags in the child component.)
6. The parent component determines which module is clicked based on the returned tabs[] subscript