VDone Demo VDone Demo
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)

Nikolay Tuzov

Backend Developer
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)
  • 基础

  • 组件

    • Component Usage Details
    • Passing Data from Parent to Child Components
    • Child Component Emitting Events and Values to Parent
      • Parent-Child Data Passing Demo
    • Prop Validation and Non-Prop Attributes
    • Custom Events
    • Sibling Component Communication
    • Non-Parent-Child Component Communication
    • Parent Calling Child Component Methods with Arguments
    • Slots
    • Dynamic Components and v-once Directive
    • Vue Parent-Child Component Lifecycle Order
  • 过渡&动画

  • 可复用性&组合

  • 工具

  • 规模化

  • Vuex

  • 其他

  • 《Vue》笔记
  • 组件
xugaoyi
2020-02-04
Contents

Child Component Emitting Events and Values to Parent

# Child Component Emitting Events and Values to Parent

API (opens new window)

The child component emits events and values to the parent using $emit (multiple values can be passed):

this.$emit('fnX', value)
1

The parent component listens to the event emitted by the child component using v-on, and triggers a new event that can receive the passed values:

<ComponentName @fnX="fnY"></ComponentName>


methods: {
	fnY(value) {
		console.log(value)
	}
}
1
2
3
4
5
6
7
8

# Parent-Child Data Passing Demo

See the Pen mdJVqgg by xugaoyi (@xugaoyi) on CodePen.

Edit (opens new window)
#Vue
Last Updated: 2026/03/21, 12:14:36
Passing Data from Parent to Child Components
Prop Validation and Non-Prop Attributes

← Passing Data from Parent to Child Components Prop Validation and Non-Prop Attributes→

Recent Updates
01
How I Discovered Disposable Email — A True Story
06-12
02
Animations in Grid Layout
09-15
03
Renaming a Git Branch
08-11
More Articles >
Theme by VDone | Copyright © 2026-2026 Nikolay Tuzov | MIT License | Telegram
  • Auto
  • Light Mode
  • Dark Mode
  • Reading Mode