vue中父调用子组件的方法
首先父组件中
引入子组件
import Son from '@/components/son.vue'
在components中注册自组件
components: { Son},
在使用子组件时在子组件元素上加上ref
<Son ref ="Son_box"></Son>
使用子组件方法
this.$refs.map_box.子组件方法名()
import Son from '@/components/son.vue'
在components中注册自组件
components: { Son},
在使用子组件时在子组件元素上加上ref
<Son ref ="Son_box"></Son>
使用子组件方法
this.$refs.map_box.子组件方法名()