Skip to content

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

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

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

Activity

xyfll7

xyfll7 commented on Jun 28, 2019

@xyfll7

传递一个对象出去

webread

webread commented on Jul 17, 2019

@webread

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

StitchC

StitchC commented on Oct 5, 2019

@StitchC

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

fireairforce

fireairforce commented on Oct 5, 2019

@fireairforce

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

Vue-protoType

Vue-protoType commented on Jan 14, 2020

@Vue-protoType

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

liushengguang

liushengguang commented on Apr 29, 2020

@liushengguang

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

MoMoOwO

MoMoOwO commented on Sep 24, 2020

@MoMoOwO

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@liushengguang@StitchC@Vue-protoType@xyfll7

        Issue actions

          [vue] vue自定义事件中父组件怎么接收子组件的多个参数? · Issue #468 · haizlin/fe-interview