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

[checkbox] 横向多选框无法响应reactive定义的数据 #1023

Closed
Digoler opened this issue Aug 12, 2023 · 2 comments
Closed

[checkbox] 横向多选框无法响应reactive定义的数据 #1023

Digoler opened this issue Aug 12, 2023 · 2 comments
Labels
question Further information is requested

Comments

@Digoler
Copy link

Digoler commented Aug 12, 2023

tdesign-mobile-vue 版本

1.0.0-rc.6

重现链接

https://github.com/Digoler/TDesin-Checkbox

重现步骤

pnpm install 运行项目打开即可,相关描述已经写在页面中

期望结果

点击能够正常响应数据

实际结果

点击多选框无反应,reactive定义的复杂数据类型无变化

框架版本

No response

浏览器版本

No response

系统版本

Window11

Node版本

16

补充说明

null

@github-actions
Copy link
Contributor

👋 @Digoler,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao
Copy link
Collaborator

anlyyao commented Aug 14, 2023

emmmm····,不支持reactive([])不是组件的 bug。
v-model 不支持reactive([]),它的更新原理是重新赋值来替换原始值,所以要使用 ref 或者对象属性(比如 v-model="obj.a")。
参考:
vModel源码
Checkbox used v-model doesn't work on a reactive variable
Checkbox v-model array mutation

@anlyyao anlyyao added the question Further information is requested label Aug 14, 2023
@anlyyao anlyyao closed this as completed Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants