vue组件 emit调用
文章目录
- emit方式调用父组件的方法
- 还可以用$parent.list(1)
//1 父组件
<editcomponent ref="edit" @toList="list(1)" ></editcomponent>
自定义事件, 事件名为toList
//2 子组件
self.$emit('toList');//向父组件emit toList事件
//1 父组件
<editcomponent ref="edit" @toList="list(1)" ></editcomponent>
自定义事件, 事件名为toList
//2 子组件
self.$emit('toList');//向父组件emit toList事件
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论