Procházet zdrojové kódy

expand以事件形式发布

zzzz před 5 roky
rodič
revize
00efa5e089
1 změnil soubory, kde provedl 1 přidání a 5 odebrání
  1. 1 5
      src/components/Table/index.js

+ 1 - 5
src/components/Table/index.js

@@ -23,10 +23,6 @@ export default {
       type: Function,
       required: true
     },
-    onExpand: {
-      type: Function,
-      required: false
-    },
     pageNum: {
       type: Number,
       default: 1
@@ -305,7 +301,7 @@ export default {
       return props[k]
     })
     const table = (
-      <a-table {...{ props, scopedSlots: { ...this.$scopedSlots } }} onChange={this.loadData} onExpand={ (expanded, record) => { this.onExpand && this.onExpand(expanded, record) } }>
+      <a-table {...{ props, scopedSlots: { ...this.$scopedSlots } }} onChange={this.loadData} onExpand={ (expanded, record) => { this.$emit('expand', expanded, record) } }>
         { Object.keys(this.$slots).map(name => (<template slot={name}>{this.$slots[name]}</template>)) }
       </a-table>
     )