Vue 骚操作

子组件

actionHandle(type, record) {
      this.$emit('action', type, record, bool => {
        if (bool) {
          alert('success!')
          this.getTableData()
        }
      })
 },

 

 

父组件

onAction(type, record, callback) {
      callback(true)
}

 

当 callback 传入的参数 为 true 时, 子组件 会回调执行

posted @ 2020-05-26 18:45  winyh  阅读(284)  评论(0编辑  收藏  举报