当前位置: 首页 前端

VUE中父组件如何调用子组件的方法

栏目:前端 作者:xiaofan 时间:2024-09-02 14:59:49

VUE中父组件如何调用子组件的方法:

通过ref直接调用子组件的方法:

调用:this.$refs.map_label.方法名();

通过$parent子组获取父组件的值

this.$parent.$data.变量名


阅读:204次

分类栏目