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

Table: fix the bug setting default-sort to Table triggers sort-change… #14625

Merged
merged 5 commits into from
Apr 22, 2019

Conversation

PeanutWatson
Copy link
Contributor

Fix the bug when setting default-sort prop to Table, it will trigger sort-change function directly.
To Closes #13750

@element-bot
Copy link
Member

element-bot commented Mar 8, 2019

Deploy preview for element ready!

Built with commit d0164d5

https://deploy-preview-14625--element.netlify.com

@yohannpoli
Copy link

Any news on this please?

@ziyoung ziyoung added this to the 2.8.0 milestone Apr 4, 2019
@ziyoung ziyoung self-requested a review April 4, 2019 05:51
@ziyoung
Copy link
Contributor

ziyoung commented Apr 17, 2019

@PeanutWatson 修改一下。另外这个属性 isDefault改成 init 吧。

@PeanutWatson
Copy link
Contributor Author

@PeanutWatson 修改一下。另外这个属性 isDefault改成 init 吧。

好滴,多谢指教,我修改一下。

@PeanutWatson
Copy link
Contributor Author

@ziyoung 已做了修改,将isDefault改为init并提至table-header中的mounted函数中传到名为sort的 mutation中,不知这样可以吗?如果可以,是否可以把init提到table-header的 props中的defaultSort的default属性中?

@ziyoung
Copy link
Contributor

ziyoung commented Apr 22, 2019

@PeanutWatson 帮你调整了一下的部分代码。核心逻辑没变。

@ziyoung ziyoung merged commit 1967cd2 into ElemeFE:dev Apr 22, 2019
@PeanutWatson
Copy link
Contributor Author

@PeanutWatson 帮你调整了一下的部分代码。核心逻辑没变。
好的,多谢。看到您update 的提交中把state.init删除,直接把从options获取的init传进nextTick 的callback 函数中,貌似我试的时候nextTick的callback 函数没法接收到init的值?所以才像上面的prop,order一样放在states中,麻烦指教一下。

@ziyoung
Copy link
Contributor

ziyoung commented Apr 22, 2019

@PeanutWatson 如果还有 bug 的话,提供一个链接吧。
就目前的问题来看,仅仅排序的时候,需要一个 init。我是觉得往 state 中加可行,但是没有必要。

FAKER-A pushed a commit to FAKER-A/element that referenced this pull request May 7, 2019
weisiren168 pushed a commit to weisiren168/element that referenced this pull request Jun 20, 2019
@lightning0016
Copy link

@ziyoung 2.11又重现了

@korewang
Copy link

korewang commented Jan 3, 2020

在用table组件的时候sort-change 会触发两次http的请求,有遇到过的吗,如何解决

lzq4047 pushed a commit to lzq4047/element that referenced this pull request May 22, 2020
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

Successfully merging this pull request may close these issues.

[Bug Report] Setting default-sort to Table triggers sort-change events directly
6 participants