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

feat: 支持监听 el-table 事件(新增 prop:tableEventHandlers) #309

Closed donaldshen closed 4 years ago

donaldshen commented 4 years ago

Why

fix #307 close #308 ,区别是支持 camelCase 的 eventName

How

tableEventHandlers 会 v-on 到 el-table 上

Test

image image

Doc

新增 table-props-events.md

netlify[bot] commented 4 years ago

Deploy preview for el-data-table ready!

Built with commit ec72a3ace1682f370c90219e3d53b6ecc9e2c1ec

https://deploy-preview-309--el-data-table.netlify.app

eviIIt commented 4 years ago

参考隔壁 el-form-renderer

tableAttribute: {
  stripe: true,
  on: {
    rowClick: () => {},
  }
}

看上去也不错

donaldshen commented 4 years ago

参考隔壁 el-form-renderer

tableAttribute: {
  stripe: true,
  on: {
    rowClick: () => {},
  }
}

看上去也不错

那就不如 #308 了。form-renderer 属性和事件监听器是同一层级。table 是合在一起写,如果多嵌一层 on 反而导致设计不一致

// form-renderer
{
  content: [
    {
      el: {
        stripe: ture,
      }
      on: {
        rowClick() {}
      }
    }
  ]
}

只是为了事件监听器时,就要嵌两层😟

{
  tableConfig: {
    tableAttrs: {
      on: {
        rowClick() {}
      }
    }
  }
}