共计 158 个字符,预计需要花费 1 分钟才能阅读完成。
- emit 形式调用父组件的办法
- 还能够用 $parent.list(1)
//1 父组件 | |
<editcomponent ref="edit" @toList="list(1)" ></editcomponent> | |
自定义事件, 事件名为 toList | |
//2 子组件 | |
self.$emit('toList');// 向父组件 emit toList 事件 | |
正文完
共计 158 个字符,预计需要花费 1 分钟才能阅读完成。
//1 父组件 | |
<editcomponent ref="edit" @toList="list(1)" ></editcomponent> | |
自定义事件, 事件名为 toList | |
//2 子组件 | |
self.$emit('toList');// 向父组件 emit toList 事件 | |