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

当nut-popup搭配nut-checkboxgroup一起使用时, 每当关掉popup时, checkboxgroup绑定的v-model会自动减掉最后一个元素 #2270

Closed
starhao opened this issue May 5, 2023 · 2 comments · Fixed by #2308
Assignees
Labels
improvement 一些可以优化的地方
Milestone

Comments

@starhao
Copy link

starhao commented May 5, 2023

NutUI scenes(nutui 场景)

H5(@nutui/nutui)

NutUI-vue version(nutui-vue 版本)

4.0.6

Vue version(vue 版本)

3.3.0-alpha.13

Operating environment(运行环境)

dev:h5

Citation method(引用方式)

npm

Node version(node 版本)

18.16.0

Browser and its version(浏览器及其版本)

112.0.5615.137

System and its version(系统及其版本)

MacOS13.0

Reproduction link(重现链接)

codesandbox.io

Steps to reproduce(重现步骤)

1,点开弹出层
2,勾选弹出层的checkbox
3,点击界面其他位置, 让弹出层关闭
4,当前选中值所显示的值会自动减掉最后一个元素

What is expected?(期望的结果是什么?)

关闭弹出层时, checkbox所选的值不变

What is actually happening?(实际的结果是什么?)

当前选中值所显示的值会自动减掉最后一个元素

@eiinu eiinu self-assigned this May 5, 2023
@eiinu
Copy link
Member

eiinu commented May 5, 2023

关联 Issue/PR:#2189 #2190

@eiinu eiinu added this to the v4.0.7 milestone May 8, 2023
@eiinu eiinu added the bug label May 9, 2023
@eiinu eiinu modified the milestones: v4.0.7, v4.0.8 May 14, 2023
@eiinu
Copy link
Member

eiinu commented May 23, 2023

主要原因:
checkbox 销毁时(例如 v-for 场景),会导致 checkbox-group 上的 v-model 中移除对应的值,Popup 在关闭时默认会被销毁。
临时解决办法:
Popup 设置 destroy-on-close 为 false,不销毁,就不会导致 v-model 中的值变动。

下个版本 4.0.8 会优化该问题

@eiinu eiinu added improvement 一些可以优化的地方 and removed bug labels May 23, 2023
@eiinu eiinu linked a pull request May 23, 2023 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement 一些可以优化的地方
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants