1,子组件获取父组件参数 --- props
<Log :parentID="1"></Log>
<-- 子组件获取 -->
props:['parentID']
2,子组件调用夫组件事件 --- $emit()
<Log @alert="alert"></Log>
<-- 子组件调用 -->
<button @click="alert"></button>
alert(){
this.$emit('alert');
}
3,夫组件获取子组件 --- ref
<Log ref="log"></Log>
//获取
this.$refs.log
//获取子组件data里面的数据
this.$refs.log.count
//获取子组件methoud里面的方法
this.$refs.log.getInit();