mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Area): failed to render picker mask after reopened (#10664)
This commit is contained in:
parent
1fa454f7ad
commit
0dc09cab8c
@ -122,6 +122,14 @@ exports[`should render two columns when columns-num prop is two 1`] = `
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="van-picker__mask"
|
||||||
|
style="background-size: 100% 110px;"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="van-hairline-unset--top-bottom van-picker__frame"
|
||||||
|
style="height: 44px;"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -164,11 +164,12 @@ export default defineComponent({
|
|||||||
formattedColumns.value = columns as PickerObjectColumn[];
|
formattedColumns.value = columns as PickerObjectColumn[];
|
||||||
}
|
}
|
||||||
|
|
||||||
hasOptions.value = formattedColumns.value.some(
|
hasOptions.value =
|
||||||
(item) =>
|
formattedColumns.value.some(
|
||||||
item[columnsFieldNames.value.values] &&
|
(item) =>
|
||||||
item[columnsFieldNames.value.values].length !== 0
|
item[columnsFieldNames.value.values] &&
|
||||||
);
|
item[columnsFieldNames.value.values].length !== 0
|
||||||
|
) || children.some((item) => item.hasOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
// get indexes of all columns
|
// get indexes of all columns
|
||||||
|
@ -283,6 +283,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
const getValue = (): PickerOption => state.options[state.index];
|
const getValue = (): PickerOption => state.options[state.index];
|
||||||
|
|
||||||
|
const hasOptions = () => state.options.length;
|
||||||
|
|
||||||
setIndex(state.index);
|
setIndex(state.index);
|
||||||
|
|
||||||
useParent(PICKER_KEY);
|
useParent(PICKER_KEY);
|
||||||
@ -292,6 +294,7 @@ export default defineComponent({
|
|||||||
getValue,
|
getValue,
|
||||||
setValue,
|
setValue,
|
||||||
setOptions,
|
setOptions,
|
||||||
|
hasOptions,
|
||||||
stopMomentum,
|
stopMomentum,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user