mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Picker): empty column will cause error (#11249)
This commit is contained in:
parent
83dcbe6f5f
commit
1f917e9a2a
@ -97,8 +97,10 @@ export default defineComponent({
|
||||
currentOffset.value = offset;
|
||||
};
|
||||
|
||||
const isReadonly = () => props.readonly || !props.options.length;
|
||||
|
||||
const onClickOption = (index: number) => {
|
||||
if (moving || props.readonly) {
|
||||
if (moving || isReadonly()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -134,7 +136,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const onTouchStart = (event: TouchEvent) => {
|
||||
if (props.readonly) {
|
||||
if (isReadonly()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,7 +155,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const onTouchMove = (event: TouchEvent) => {
|
||||
if (props.readonly) {
|
||||
if (isReadonly()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -178,7 +180,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const onTouchEnd = () => {
|
||||
if (props.readonly) {
|
||||
if (isReadonly()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user