Element table Two-time Package parent-child component pass-through component communication

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.