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

【功能问题】如何添加 el-table 自带的事件 #116

Closed
beautycss opened this issue Jun 3, 2019 · 3 comments
Closed

【功能问题】如何添加 el-table 自带的事件 #116

beautycss opened this issue Jun 3, 2019 · 3 comments

Comments

@beautycss
Copy link

beautycss commented Jun 3, 2019

你好,我已经使用了你们的组件做好了数据渲染,都挺好的。

现在想使用el-table自带的事件row-click事件做点击行的处理,发现无法传递到table组件。
你们提供了一个tableAttrs是传递数据的,那请问事件如何传递过去?

我觉得使用表格自带的一些事件应该是基础需求,考虑扩展一下,或者把el-table自带的事件加上去?

@donaldshen
Copy link
Contributor

你可以通过直接引用内部el-table的方式来添加事件监听。比如你为el-data-table添加ref="dataTable"属性,你就可以这样子this.$refs.dataTable.$refs.table.$on('row-click', handler)

@beautycss
Copy link
Author

试过了可以,谢谢。👍

@levy9527
Copy link
Contributor

levy9527 commented Jun 3, 2019

感谢你的认可 @beautycss

@levy9527 levy9527 closed this as completed Jun 3, 2019
@levy9527 levy9527 pinned this issue Sep 9, 2019
@levy9527 levy9527 changed the title 【功能问题】使用el-table自带的事件如何处理 【功能问题】如何添加 el-table 自带的事件 Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants