Prechádzať zdrojové kódy

expand以事件形式发布

zzzz 5 rokov pred
rodič
commit
00efa5e089
1 zmenil súbory, kde vykonal 1 pridanie a 5 odobranie
  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>
     )