perf: vnSelectPaginate
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
e92701de23
commit
70ba68393e
|
@ -87,7 +87,11 @@ const selectValue = computed({
|
|||
return $props.modelValue;
|
||||
},
|
||||
set(value) {
|
||||
isFiltered = false;
|
||||
filterValue.value = !!value;
|
||||
arrayData.store.page = 0;
|
||||
arrayData.store.hasMoreData = true;
|
||||
|
||||
emit('update:modelValue', value);
|
||||
},
|
||||
});
|
||||
|
@ -95,7 +99,8 @@ const selectValue = computed({
|
|||
const useURL = computed(() => $props.url);
|
||||
|
||||
const $attrs = useAttrs();
|
||||
const arrayDataKey = $props.dataKey ?? ($props.url !== '' ? $props.url : $attrs.label);
|
||||
const arrayDataKey =
|
||||
$props.dataKey ?? ($props.url.length > 0 ? $props.url : $attrs.label);
|
||||
const arrayDataOptions = {
|
||||
url: $props.url,
|
||||
where: $props.where,
|
||||
|
@ -164,6 +169,10 @@ async function fetchFilter(val) {
|
|||
}
|
||||
let isFiltered = false;
|
||||
watch(filterValue, (newVal, oldVal) => {
|
||||
// if (vnSelectRef.value.modelValue) {
|
||||
// isFiltered = true;
|
||||
// return;
|
||||
// }
|
||||
const _isFiltered = oldVal?.length < newVal?.length;
|
||||
if (!_isFiltered && isFiltered) {
|
||||
arrayData.store.hasMoreData = true;
|
||||
|
|
|
@ -104,6 +104,7 @@ const contactChannels = ref([]);
|
|||
:where="{ role: 'salesPerson' }"
|
||||
emit-value
|
||||
map-options
|
||||
clearable
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-filter="firstName"
|
||||
|
|
Loading…
Reference in New Issue