diff --git a/packages/devui-vue/devui/category-search/src/category-search.tsx b/packages/devui-vue/devui/category-search/src/category-search.tsx index 6f85d396d5..00978efe6c 100644 --- a/packages/devui-vue/devui/category-search/src/category-search.tsx +++ b/packages/devui-vue/devui/category-search/src/category-search.tsx @@ -12,51 +12,53 @@ import { useCategorySearch } from './composables/use-category-search'; import './category-search.scss'; export default defineComponent({ - name: 'DCategorySearch', - props: categorySearchProps, - emits: ['search', 'selectedTagsChange', 'createFilter', 'clearAll', 'searchKeyChange'], - setup(props: CategorySearchProps, ctx: SetupContext) { - const { - rootRef, - scrollBarRef, - inputRef, - isHover, - containerClasses, - innerSelectedTags, - joinLabelTypes, - showExtendedConfig, - operationConfig, - onSearch, - } = useCategorySearch(props, ctx); + name: 'DCategorySearch', + props: categorySearchProps, + emits: ['search', 'selectedTagsChange', 'createFilter', 'clearAll', 'searchKeyChange'], + setup(props: CategorySearchProps, ctx: SetupContext) { + const { + rootRef, + scrollBarRef, + inputRef, + isHover, + containerClasses, + innerSelectedTags, + joinLabelTypes, + showExtendedConfig, + operationConfig, + onSearch, + } = useCategorySearch(props, ctx); - return () => ( -
(isHover.value = true)} - onMouseleave={() => (isHover.value = false)}> -
- -
-
- -
- {showExtendedConfig.value && ( -
- {operationConfig.clear?.show && ( - <>{ctx.slots.clear?.() ?? } - )} - {operationConfig.save?.show && <>{ctx.slots.save?.() ?? }} - {operationConfig.more?.show && <>{ctx.slots.more?.() ?? }} - {ctx.slots.operation?.()} -
- )} -
- ); - }, + return () => ( +
(isHover.value = true)} + onMouseleave={() => (isHover.value = false)}> + {ctx.slots.searchIcon?.() ?? ( +
+ +
+ )} +
+ +
+ {showExtendedConfig.value && ( +
+ {operationConfig.clear?.show && ( + <>{ctx.slots.clear?.() ?? } + )} + {operationConfig.save?.show && <>{ctx.slots.save?.() ?? }} + {operationConfig.more?.show && <>{ctx.slots.more?.() ?? }} + {ctx.slots.operation?.()} +
+ )} +
+ ); + }, }); diff --git a/packages/devui-vue/docs/components/category-search/index.md b/packages/devui-vue/docs/components/category-search/index.md index b793d8227b..2830a311e7 100644 --- a/packages/devui-vue/docs/components/category-search/index.md +++ b/packages/devui-vue/docs/components/category-search/index.md @@ -391,6 +391,7 @@ export default defineComponent({ | save | 自定义保存图标 | | | | more | 自定义更多图标 | | | | operation | 自定义除`clear`、`save`、`more`外的其他图标 | | [自定义扩展按钮](#自定义扩展按钮) | +| searchIcon | 自定义搜索图标 | | | ### CategorySearch 方法