We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<AtActionSheet isOpened={this.state.openActionSheet} cancelText='取消' title={this.state.actionSheetTitle} onCancel={this.handleClose} onClose={this.handleClose}> <AtActionSheetItem> 相册选择 </AtActionSheetItem> <AtActionSheetItem> 拍照上传 </AtActionSheetItem> </AtActionSheet>
handleClose() { this.setState({ openActionSheet: false }) } // 展示 toggleActionSheet(imageType, e) { e.stopPropagation(); const title = this.idcardObj[imageType]; console.log(title) // 这里有打印出不同的title字符串 this.setState({ openActionSheet: true, actionSheetTitle: title }); }
设置title属性为动态赋值即可
Taro 1.2.0 Taro UI 1.5.2
1.2.0
1.5.2
支持动态title变化
title值变量实际效果没渲染
The text was updated successfully, but these errors were encountered:
确认过state更新的,是组件不能动态改title
this.setState({ actionSheetTitle: title }, () => { this.setState({ openActionSheet: true, }) console.log(this.state.actionSheetTitle) });
Sorry, something went wrong.
没有重现你说的问题 可否提供个简单案例 代码层面上 title 也是动态的
定位到了 ~~
9ed24d1
SzHeJason
No branches or pull requests
代码
重现步骤
设置title属性为动态赋值即可
依赖的版本号
Taro
1.2.0
Taro UI
1.5.2
预期结果
支持动态title变化
实际结果
title值变量实际效果没渲染
截图
The text was updated successfully, but these errors were encountered: