本文转载自:
https://www.jianshu.com/p/fcd3aabfe2fb

一个参数:
子组件:

this.$emit('closeChange',false);

父组件:

<posilCom @closeChange="closeCom($event)"></posilCom>
closeCom(msg) {
    this.msg = msg;
}

多个参数:
子组件:

this.$emit('closeChange',false,true);

父组件:

<posilCom @closeChange="closeCom(arguments)"></posilCom>
closeCom(msg) {
    this.msg1 = msg[0];
    this.msg2 = msg[1];
}
Logo

前往低代码交流专区

更多推荐