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
问题描述 目前使用的taro版本是 1.2.26,以下是代码清单。
复现步骤 [复现问题的步骤]
// 这里可以贴代码 import Taro, { Component } from '@tarojs/taro'; import { View, Text, Picker } from '@tarojs/components' import './test.scss'; class Test extends Component { constructor(props) { super(props); this.validType = ''; let SID = 2; let selector = [ {value:'a', key:1}, {value:'b', key:2}, {value:'c', key:3}, {value:'d', key:4}, ]; this.state = { selector:selector, sid: SID, selectorChecked:selector[SID].value }; } onChange(e){ console.log(e.detail.value); this.setState({ selectorChecked: this.state.selector[e.detail.value].value }); } handleClick(){ let selector = [ {value:'aa', key:5}, {value:'bb', key:6}, {value:'cc', key:7}, {value:'dd', key:8}, ]; let SID = 1; this.setState({ selector:selector, sid: SID, selectorChecked:selector[SID].value }); } render() { return ( <View className='test'> <View className='page-section'> <Text onClick={this.handleClick.bind(this)}>点击更新Picker(a->aa)</Text> <View> <Picker mode='selector' range={this.state.selector} value={this.state.sid} rangeKey='value' onChange={this.onChange.bind(this)}> <View className='picker'> 当前选择:{this.state.selectorChecked} </View> </Picker> </View> </View> </View> ); } } export default Test;
期望行为 像这种情况如何处理?能不能直接把Picker销毁,再重新重新实例化,变成新值range与value.
系统信息
Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。
taro info
补充信息 主要是原因是更新range 与 value的时候,并不触发Picker的 updateHeight()
The text was updated successfully, but these errors were encountered:
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
Sorry, something went wrong.
CC @jinjinjin0731
36d3b0f
已修复,待下个版本。 如果紧急需要, 你可以在 node_modules 的 @tarojs / components 中找到该组件,按照提交修改一下即可
感谢感谢
jinjinjin0731
No branches or pull requests
问题描述
目前使用的taro版本是 1.2.26,以下是代码清单。
复现步骤
[复现问题的步骤]
2.“ 点击更新Picker(a->aa)” 这个时候 range 与 value(位置: 1)发生变更,
error: 这个时候的Picker是停留在位置3。
期望行为
像这种情况如何处理?能不能直接把Picker销毁,再重新重新实例化,变成新值range与value.
系统信息
补充信息
主要是原因是更新range 与 value的时候,并不触发Picker的 updateHeight()
The text was updated successfully, but these errors were encountered: