-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Picker 组件在 multiSelector 模式时列数与 range 数组长度不一致 #4759
Labels
question
Further information is requested
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
CC @Chen-jj |
这个有具体的计划吗? |
@heynext 这样吧 const options = useMemo(() => {
if (selected[0]) {
return [
FIRST,
SECOND,
[]
]
}
return [
FIRST,
SECOND,
THIRD,
]
}, [selected]) |
@heynext 写了个原生例子如下。 应该是直接在 bindcolumnchange 里 setData 而 setData bindtap 里 setData Component({
data: {
options: [
['A', 'B'],
[2019, 2020, 2011],
[1, 2, 3]
]
},
methods: {
anonymousFunc0 (e) {
console.log('ok: ', e)
if (e.detail.column === 0 && e.detail.value === 1) {
console.log('setData')
this.setData({
options: [
['A', 'B'],
[2019, 2020, 2011]
]
})
}
},
onClick () {
console.log('c')
this.setData({
options: [
['A', 'B'],
[2019, 2020, 2011]
]
})
}
}
}) <view>
<picker mode="multiSelector" bindcolumnchange="anonymousFunc0" range="{{options}}">
<view class="picker">请选择</view>
</picker>
<view bindtap="onClick">click</view>
</view> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
微信小程序端,Picker 组件在 multiSelector 模式时,当 range 数组长度发生变化时,UI 上并没有发生相应变化。如下图和下面代码所示,选择 A 时,range 数组长度为 3,B 时,range 数组长度为 2,但实际上两种情况 UI 上都是有三列
复现步骤
期望行为
选择 A 时展示三列,选择 B 时展示两列
系统信息
The text was updated successfully, but these errors were encountered: