mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +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>
|
||||
</ul>
|
||||
</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>
|
||||
`;
|
||||
|
@ -164,11 +164,12 @@ export default defineComponent({
|
||||
formattedColumns.value = columns as PickerObjectColumn[];
|
||||
}
|
||||
|
||||
hasOptions.value = formattedColumns.value.some(
|
||||
(item) =>
|
||||
item[columnsFieldNames.value.values] &&
|
||||
item[columnsFieldNames.value.values].length !== 0
|
||||
);
|
||||
hasOptions.value =
|
||||
formattedColumns.value.some(
|
||||
(item) =>
|
||||
item[columnsFieldNames.value.values] &&
|
||||
item[columnsFieldNames.value.values].length !== 0
|
||||
) || children.some((item) => item.hasOptions);
|
||||
};
|
||||
|
||||
// get indexes of all columns
|
||||
|
@ -283,6 +283,8 @@ export default defineComponent({
|
||||
|
||||
const getValue = (): PickerOption => state.options[state.index];
|
||||
|
||||
const hasOptions = () => state.options.length;
|
||||
|
||||
setIndex(state.index);
|
||||
|
||||
useParent(PICKER_KEY);
|
||||
@ -292,6 +294,7 @@ export default defineComponent({
|
||||
getValue,
|
||||
setValue,
|
||||
setOptions,
|
||||
hasOptions,
|
||||
stopMomentum,
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user