vue 子组件刷新父组件
1、通过 $emit 触发
//在父组件中设置
@add = "add(val)"
//子组件中使用
this.$emit('add', newVal)
2. 使用$parent触发
//子组件直接调用
//getlist()为父组件更新数据所调用的函数
this.$parent.getList()
//在父组件中设置
@add = "add(val)"
//子组件中使用
this.$emit('add', newVal)
//子组件直接调用
//getlist()为父组件更新数据所调用的函数
this.$parent.getList()