未验证 提交 ab62739f 编写于 作者: 1 1sm 提交者: GitHub

`ApiSelect` Add `alwaysLoad` option (#1461)

* fix(modal): 取消全屏功能后关闭图标颜色异常

* chore: move to pnpm

* fix: RangePicekr在表单项中占满分配的宽度

* chore: comment format

* Revert "fix: RangePicekr在表单项中占满分配的宽度"

This reverts commit cd70e41dac294329383be3d2f0a393dc26b7f140.

* feat(ApiSelect): 新增每次加载选项
Co-authored-by: Nliushiman <smliu@gk-estor.com>
上级 b70fade5
<template>
<Select
@dropdownVisibleChange="handleFetch"
@dropdown-visible-change="handleFetch"
v-bind="$attrs"
@change="handleChange"
:options="getOptions"
......@@ -57,6 +57,7 @@
labelField: propTypes.string.def('label'),
valueField: propTypes.string.def('value'),
immediate: propTypes.bool.def(true),
alwaysLoad: propTypes.bool.def(false),
},
emits: ['options-change', 'change'],
setup(props, { emit }) {
......@@ -87,7 +88,7 @@
});
watchEffect(() => {
props.immediate && fetch();
props.immediate && !props.alwaysLoad && fetch();
});
watch(
......@@ -121,10 +122,14 @@
}
}
async function handleFetch() {
if (!props.immediate && unref(isFirstLoad)) {
await fetch();
isFirstLoad.value = false;
async function handleFetch(visible) {
if (visible) {
if (props.alwaysLoad) {
await fetch();
} else if (!props.immediate && unref(isFirstLoad)) {
await fetch();
isFirstLoad.value = false;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册