Create a new component (that is, a subcomponent) Table.vue
Sub-component edits as shown
The child component obtains the arguments passed by the parent component through props, as shown in, type indicates the data type passed to the child component, default specifies defaults, and generally does not give
Subcomponents Pass events and arguments to the parent component through event emission, $emit is the firing event, the first parameter is the event name passed to the parent component, and the second argument is the parameter passed to the parent component
The following child components are called for the parent component:
Introduce subcomponents through import in the parent component, and register
Parent component invokes subcomponents and passes parameters while listening for child component events
Parent component handles listener sub-component events
The final effect is as follows
Of course the function can continue to expand
---------------------
Small front End
Source: CSDN
Original: 80450972?utm_source=copy
Element table Two-time Package parent-child component pass-through component communication