FEMessage / el-data-table

🥘Base on element-ui, makes crud easily
https://femessage.github.io/el-data-table/
MIT License
486 stars 112 forks source link

[Feature request] 希望支持 el-table 的所有事件 #307

Closed DeepenLau closed 4 years ago

DeepenLau commented 4 years ago

Is your feature request related to a problem? Please describe. 项目中需要用到 这个 el-table 事件做某行点击后选中 checkbox image 初略看代码貌似不支持 image

Describe the solution you'd like 期望支持所有的 el-table 的事件 比如加一个 v-on="$listeners"

   <el-table
        ref="table"
        v-loading="loading"
        v-bind="tableAttrs"
        :data="data"
        :row-class-name="rowClassName"
        @selection-change="selectStrategy.onSelectionChange"
        @select="selectStrategy.onSelect"
        @select-all="selectStrategy.onSelectAll($event, selectable)"
        v-on="$listeners"
      >

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

donaldshen commented 4 years ago

this.$refs.table.$refs.table.$on('row-click', handler) 凑合用吧

donaldshen commented 4 years ago

或者加个 prop

<el-table
  ref="table"
  v-on="tableEventListeners"
>
{
  props: {
    tableEventListeners: { type: Object, default() { return {} } }
  }
}
DeepenLau commented 4 years ago

或者加个 prop

<el-table
  ref="table"
  v-on="tableEventListeners"
>
{
  props: {
    tableEventListeners: { type: Object, default() { return {} } }
  }
}

感觉这种好一点