tdesign-miniprogram
tdesign-miniprogram copied to clipboard
[notice-bar] visible 使用变量控制为false时控制台报错
tdesign-miniprogram 版本
1.1.10
重现链接
No response
重现步骤
.js 文件:
Page({
data: {
noticeVisible: false,
logs: []
}
})
.wxml 文件:
<t-notice-bar visible="{{noticeVisible}}" content="这是一条普通的通知信息"></t-notice-bar>
期望结果
No response
实际结果
基础库版本
2.33.0
补充说明
No response
👋 @zavatar,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。
试了下,并不会报错,麻烦确认下是不是这个组件的问题
试了下,并不会报错,麻烦确认下是不是这个组件的问题
试试这个片段能复现么:https://developers.weixin.qq.com/s/6ZXexDmd7eJs ,只有false时会报错,报错堆栈最后指向notice-bar.js。基础库版本需要新一些,比较旧的不会报错。
我换了 2.33.0 基础库就开始出现问题了。我研究下
我这里报错是因为content属性
错误:
Page({
data: {
noticeContent: ['abc'],
},
})
<t-notice-bar
...
content="{{noticeContent}}"
...
></t-notice-bar>
正确: ①
<t-notice-bar
...
content=""
...
></t-notice-bar>
②
<t-notice-bar
...
content="通知内容abc"
...
></t-notice-bar>
③
// a.js
Page({
...
data: {
searchValue: '',
noticeContent: [],
},
...
})
// a.wxml
<t-notice-bar
...
content="{{noticeContent}}"
...
></t-notice-bar>
④
不加content属性时,但谁会不填写通知内容?