Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

donaldshen
Copy link
Contributor

@donaldshen donaldshen commented Jul 1, 2020

Why

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

How

tableEventHandlers 会 v-on 到 el-table 上

Test

image
image

Doc

新增 table-props-events.md

@auto-add-label auto-add-label bot added the enhancement New feature or request label Jul 1, 2020
@netlify
Copy link

netlify bot commented Jul 1, 2020

Deploy preview for el-data-table ready!

Built with commit ec72a3a

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

@eviIIt
Copy link
Contributor

eviIIt commented Jul 1, 2020

参考隔壁 el-form-renderer

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

看上去也不错

@donaldshen
Copy link
Contributor Author

donaldshen commented Jul 1, 2020

参考隔壁 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() {}
      }
    }
  }
}

@donaldshen donaldshen changed the title feat: tableAttrs 支持传 event handlers feat: 支持监听 el-table 事件(新增 prop:tableEventHandlers) Jul 1, 2020
@donaldshen donaldshen merged commit 1aa1e0e into FEMessage:dev Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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