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

[tree-select] 初始options为空,后使用setData赋值,组件不渲染。 #2312

Closed
vicorn opened this issue Aug 23, 2023 · 1 comment · Fixed by #2315
Closed

[tree-select] 初始options为空,后使用setData赋值,组件不渲染。 #2312

vicorn opened this issue Aug 23, 2023 · 1 comment · Fixed by #2315
Labels
bug Something isn't working in progress issue or pull request is in progress

Comments

@vicorn
Copy link

vicorn commented Aug 23, 2023

tdesign-miniprogram 版本

1.2.0

重现链接

https://tdesign.tencent.com/miniprogram/components/tree-select

重现步骤

1.wxml

<t-tree-select options="{{options}}" value="{{value}}" bind:change="onTreeChange" />

2.js

Page({
 data: {
    options: [],
    value: [],
  },
  onLoad() {
    this.setData({
      options: generateTree(1)
    })
    // 必须要重新设置下value才能渲染
    // this.setData({
    //   value: []
    // })
  },
})

用的官网例子,先让options,value为空,然后在onLoad中使用setData重新赋值options,AppData中数据已变更,但此时组件不会渲染,需要重新赋值下value才行。

期望结果

No response

实际结果

No response

基础库版本

2.33.0

补充说明

No response

@github-actions
Copy link
Contributor

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

@LeeJim LeeJim added bug Something isn't working in progress issue or pull request is in progress labels Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress issue or pull request is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants