Skip to content

Commit 5c72c32

Browse files
authored
Merge pull request #1795 from DevCloudFE/dev
fix(editable-select): 已有自定义于远程筛选,不进行默认label过滤 (#1794)
2 parents de295d9 + a1b1141 commit 5c72c32

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/devui-vue/devui/editable-select/src/composables/use-select.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { computed, ComputedRef, getCurrentInstance, nextTick, onMounted, reactive, ref, Ref, SetupContext, watch } from 'vue';
22
import { EditableSelectProps, Option, Options } from '../editable-select-types';
33
import { createI18nTranslate } from '../../../locale/create';
4-
import { isNil } from 'lodash';
4+
import { isFunction, isNil } from 'lodash';
55

66
export interface UseSelectStatesReturnType {
77
hoveringIndex: number;
@@ -54,9 +54,16 @@ export function useSelect(
5454
const t = createI18nTranslate('DEditableSelect', app);
5555
const cachedOptions = ref(props.options);
5656

57+
const hasCustomFilter = () => {
58+
return (props.remote && isFunction(props.remoteMethod)) || isFunction(props.filterMethod);
59+
};
60+
5761
// computed
5862
const filteredOptions = computed(() => {
5963
return cachedOptions.value.filter((option) => {
64+
if (hasCustomFilter()) {
65+
return true;
66+
}
6067
return option.label.toLocaleLowerCase().includes(states.query.toLocaleLowerCase().trim());
6168
});
6269
});

packages/devui-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-devui",
3-
"version": "1.6.3-markdown.2",
3+
"version": "1.6.3-editable-select.1",
44
"license": "MIT",
55
"description": "DevUI components based on Vite and Vue3",
66
"keywords": [

0 commit comments

Comments
 (0)