Skip to content

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

@Git0814

Description

@Git0814

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();
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThis is a question, not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions