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

fix: 修复 #2372 在分页复选框表格中如果跳转到了第n页(n>1),则无法正确勾选默认选中的数据行 #2387

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

WHIPLASHCZ
Copy link

No description provided.

@examplethree
Copy link

前端小白,遇到一个类似的问题,但对原因不太有头绪,想分享一下我的尝试。这个问题的背景是,在窗口中点击新增按钮,会出现一个包含复选框表格的抽屉,在这里选中的行会在点击确认后添加到窗口中。当首次打开窗口时,若窗口中已有条目,则此时再打开抽屉,对应的条目应该是默认勾选的状态。而问题就是,如果这是第一次打开抽屉,则无法选中对应的条目,需要先关闭抽屉,重新打开,才会勾选。为了在第一次打开就看到勾选的条目,我尝试在setTimeout或RAF中获取表格的模板引用,并做对应的勾选,则可以正确显示默认的勾选。而在nextTick之类的微任务中,则获取到的模板引用还是undefined。隐约感觉是组件挂载的时机问题,但是又想不明白到底是在哪个时刻触发的挂载。

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.

2 participants