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-group中的checkbox状态checked刷新失效问题 #3293

Closed
Git0814 opened this issue Nov 19, 2024 · 3 comments
Closed

checkbox-group中的checkbox状态checked刷新失效问题 #3293

Git0814 opened this issue Nov 19, 2024 · 3 comments
Labels
question This is a question, not a bug

Comments

@Git0814
Copy link

Git0814 commented Nov 19, 2024

tdesign-miniprogram 版本

1.7.1

重现链接

No response

重现步骤

多选框checkbox状态在我更新操作之后更改为false,但刷新后再次点击任意多选框,刷新前已选的box又被自动勾选上了

期望结果

刷新后,checkbox再次勾选不会自动勾选刷新前内容

实际结果

未解决该问题

基础库版本

No response

补充说明

想要了解下js的正确步骤,或者是该怎么解决这个问题

前端代码:

<view class="section">
       <t-checkbox-group t-class="box" borderless bind:change="onCheckBoxChange0">
              <t-checkbox wx:for="{{crowns}}" wx:key="value" block="{{false}}" value="{{item.value}}" label="{{item.label}}" icon="rectangle" checked="{{ischecked}}" disabled="{{isCheckBoxDisabled}}" />
       </t-checkbox-group>
</view>

JS代码:

  onPullDownRefresh: function() {
    // 执行下拉刷新时的逻辑操作
    this.setData({ 
      enable: true ,
      keywords: '',
      startNums: [], // 选中的号冠
      digits: [], // 选中的数字
      conditions: [], // 选中的面板选项
      isInputDisabled: false,
      isCheckBoxDisabled: false,
      ischecked : false,
    });
    // 刷新完成后停止下拉刷新
    wx.stopPullDownRefresh();
  },
Copy link
Contributor

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

@jarmywang jarmywang added the question This is a question, not a bug label Nov 20, 2024
@jarmywang
Copy link
Collaborator

jarmywang commented Nov 20, 2024

可能情况:
1、value在crowns中不唯一导致的,可以参考一下wx:key的原理
2、使用了t-checkbox-group则checked状态都在t-checkbox-group管理
如果还不能解决麻烦提供代码片段(完整可复现)我们再看一下 @Git0814

@Git0814
Copy link
Author

Git0814 commented Nov 20, 2024

可能情况: 1、value在crowns中不唯一导致的,可以参考一下wx:key的原理 2、使用了t-checkbox-group则checked状态都在t-checkbox-group管理 如果还不能解决麻烦提供代码片段(完整可复现)我们再看一下 @Git0814

已解决,感谢

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