vue 父组件调用子组件方法,更新子组件

父组件:

父组件调用子组件方法:

this.$refs.child.$emit('bridge','父组件传给子组件的值')

子组件:在mounted阶段注册上bridge的方法:

this.$on('bridge', val=>{

this.initChild(val)

})

你可能感兴趣的:(vue 父组件调用子组件方法,更新子组件)