fe-interview icon indicating copy to clipboard operation
fe-interview copied to clipboard

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

Open haizhilin2013 opened this issue 7 years ago • 8 comments

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

haizhilin2013 avatar Jun 22 '19 21:06 haizhilin2013

传递一个对象出去

xyfll7 avatar Jun 28 '19 15:06 xyfll7

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

webread avatar Jul 17 '19 02:07 webread

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

StitchC avatar Oct 05 '19 06:10 StitchC

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

fireairforce avatar Oct 05 '19 06:10 fireairforce

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

Vue-protoType avatar Jan 14 '20 10:01 Vue-protoType

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

liushengguang avatar Apr 29 '20 11:04 liushengguang

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

MoMoOwO avatar Sep 24 '20 06:09 MoMoOwO

https://www.cnblogs.com/lalalagq/p/9901139.html

radio-qq avatar Dec 31 '20 02:12 radio-qq