In vue2 Passing properties from parent component to child component Subcomponents receive properties If it is not received, it needs to be received in $attrs. The disadvantage is that there is no restriction on the type, and the name is relatively long when used. The name is longer when used Vue2, parent component uses slots in child components Print the contents of a slot If the parent component uses 2 slots of the child component Parent component uses named slots in child components In vue3Notes on setupThe setup life cycle is before beforecreatedsetup can get two parameters, props and context Pass 2 properties to the child component Print context context.attrs Similar to vue2, if only part is declared, the rest is in the attrs attribute context.emit Add listener events to child components context.slot If you pass a named slot Or (recommended) Print If you pass 2 named slots SummarizeThis article ends here. I hope it can be helpful to you. I also hope that you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: Solve the mobile terminal jump problem (CSS transition, target pseudo-class)
>>: Solution to the automatic termination of docker run container
This topic is an internal sharing in the second h...
Table of contents 1.1. Network access between con...
Implementation requirements The form imitating El...
Preface Recently I encountered a requirement, whi...
Table of contents 1. Usage of DATETIME and TIMEST...
Table of contents Overview Getting started with d...
The following situations were discovered during d...
1. What is floating? Floating, as the name sugges...
Detailed explanation of MySQL stored procedures, ...
Table of contents Preface text 1. Panel 2. Huaron...
Table of contents Docker image download Start mys...
Last night, I was looking at an interview question...
Use the for loop to import the zabbix image into ...
This article shares the specific code of jQuery t...
I reinstalled the system some time ago, but I did...