Skip to content

[vue] vue自定义事件中父组件怎么接收子组件的多个参数? #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haizhilin2013 opened this issue Jun 22, 2019 · 8 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] vue自定义事件中父组件怎么接收子组件的多个参数?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 22, 2019
@xyfll7
Copy link

xyfll7 commented Jun 28, 2019

传递一个对象出去

@webread
Copy link

webread commented Jul 17, 2019

this.$emit("eventName",data)
data为一个对象

@StitchC
Copy link

StitchC commented Oct 5, 2019

子组件传递多个参数,父组件用展开运算符获取

@fireairforce
Copy link

父组件那边用解构赋值取。。。

@Vue-protoType
Copy link

使用.sync也可以实现传多个参数

@liushengguang
Copy link

子组件传递一个对象,父组件用展开运算符获取参数

@MoMoOwO
Copy link

MoMoOwO commented Sep 24, 2020

this.$emit("eventName",data)
data 对象或数组都可以的。

@radio-qq
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

9 participants