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

PickerView再数组越界时不支持同时修改value和range吗 #7916

Open
coolpail opened this issue Oct 26, 2020 · 1 comment
Open

PickerView再数组越界时不支持同时修改value和range吗 #7916

coolpail opened this issue Oct 26, 2020 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@coolpail
Copy link

相关平台

微信小程序

小程序基础库: 2.13.1
使用框架: React

复现步骤

<PickerView
    className='pk-picker__view'
    indicator-class='pk-picker__current'
    onChange={e => {
        if (onColumnChange) {
            onColumnChange(e.detail.value);
        }
    }}
    value={value}
>
    <PickerViewColumn>
        {range.map((item, idx) => (
            <View key={`${idx}${item}`} className='pk-picker__item'>
                {typeof item === 'function'
                    ? item()
                    : rangeKey
                    ? item[rangeKey]
                    : item}
            </View>
        ))}
    </PickerViewColumn>
</PickerView>

//初始值
this.state = {
    range: [1, 2, 3],
    val: [1],
}
this.setState({
  range: [1, 2, 3, 4]
  val: [3]
})
  OS: mac os
Binaries:
  Node: 12.16.3
  Yarn: 1.12.3 
  npm: 5.6.0


---
### 补充信息
数组越界下会发生

<!-- generated by taro-issues. 请勿修改或删除此行注释 --><!--labels=T-weapp,V-3,F-react-->
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Oct 26, 2020
@coolpail
Copy link
Author

"@tarojs/taro": "3.0.17", PickerView Demo(react) 无法显示https://nervjs.github.io/taro/docs/components/forms/picker-view/

问题已hack,但确实存在,你这demo没什么用的,三个数组并不互相关联,没参考性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

1 participant