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

[radio-group] 选项配置中的block无效 #2394

Open
fatindeed opened this issue Oct 15, 2023 · 3 comments
Open

[radio-group] 选项配置中的block无效 #2394

fatindeed opened this issue Oct 15, 2023 · 3 comments
Labels
question This is a question, not a bug

Comments

@fatindeed
Copy link

tdesign-miniprogram 版本

295dfd3

重现链接

https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/radio-group/radio-group.wxml#L11

重现步骤

block="{{item.block || true}}"
这段代码无论item.block设置什么,永远返回true

期望结果

item.block设置为false时,可以返回false

实际结果

item.block设置为false时,返回true

基础库版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

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

@fatindeed
Copy link
Author

快速fix的话可以改为block="{{typeof item.block == 'boolean' ? item.block : true}}"

@anlyyao
Copy link
Collaborator

anlyyao commented Oct 18, 2023

@fatindeed

item.block || true // 这段代码无论item.block设置什么,确实永远返回true,代码上没问题哈

block="{{!!item.block}}" // 推荐

@anlyyao anlyyao added the question This is a question, not a bug label Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants