当前位置:网站首页>Harmonyos second training

Harmonyos second training

2022-06-21 04:48:00 ljy��516

Video tutorial 10—12

Text tutorial

Catalog

1. Creation of custom components

2. Call of custom build

3. Implementation of parent-child component communication function

4. Routing function implementation


1. Creation of custom components

      

2. Call of custom build


1.name Property refers to the custom component name ( Not required ), Component names are case insensitive , The default is lowercase ,src Properties refer to custom components hml File path ( Required ), If not set name attribute , It is used by default hml Use the file name as the component name .

2. Event binding : Binding subcomponent events in custom components use (on|@)child1 grammar , Passed in the child component this.$emit('child1', { params: ' Pass parameters ' }) Trigger the event and transfer the value , Parent component execution bindParentVmMethod Method and receive the parameters passed by the subcomponent .

3. Implementation of parent-child component communication function

4. Routing function implementation

 

原网站

版权声明
本文为[ljy��516]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206210439054128.html