From 6d03aed51dbcfd05cc590ddafb6c87a3ccc2cbe8 Mon Sep 17 00:00:00 2001 From: vben Date: Sat, 9 Nov 2024 15:46:05 +0800 Subject: [PATCH] fix: drawer component header does not take effect --- packages/@core/base/icons/build.config.ts | 16 +----- packages/@core/base/icons/src/index.ts | 1 - packages/@core/base/icons/src/lucide.ts | 1 - .../ui-kit/popup-ui/src/drawer/drawer.vue | 8 ++- .../components/icon-picker/icon-picker.vue | 50 +++++++++++-------- packages/effects/hooks/src/use-pagination.ts | 6 +-- .../src/icons/empty-icon.vue} | 0 packages/icons/src/index.ts | 1 + 8 files changed, 42 insertions(+), 41 deletions(-) rename packages/{@core/base/icons/src/components/empty.vue => icons/src/icons/empty-icon.vue} (100%) diff --git a/packages/@core/base/icons/build.config.ts b/packages/@core/base/icons/build.config.ts index 18eaa604cb4..97e572c56d1 100644 --- a/packages/@core/base/icons/build.config.ts +++ b/packages/@core/base/icons/build.config.ts @@ -3,19 +3,5 @@ import { defineBuildConfig } from 'unbuild'; export default defineBuildConfig({ clean: true, declaration: true, - entries: [ - { - builder: 'mkdist', - input: './src', - loaders: ['vue'], - pattern: ['**/*.vue'], - }, - { - builder: 'mkdist', - format: 'esm', - input: './src', - loaders: ['js'], - pattern: ['**/*.ts'], - }, - ], + entries: ['src/index'], }); diff --git a/packages/@core/base/icons/src/index.ts b/packages/@core/base/icons/src/index.ts index 85a47d27a2f..183c45de750 100644 --- a/packages/@core/base/icons/src/index.ts +++ b/packages/@core/base/icons/src/index.ts @@ -1,4 +1,3 @@ -export { default as EmptyIcon } from './components/empty.vue'; export * from './create-icon'; export * from './lucide'; diff --git a/packages/@core/base/icons/src/lucide.ts b/packages/@core/base/icons/src/lucide.ts index 152dc5cd205..97603eb5647 100644 --- a/packages/@core/base/icons/src/lucide.ts +++ b/packages/@core/base/icons/src/lucide.ts @@ -41,7 +41,6 @@ export { Minimize, Minimize2, MoonStar, - Package2, Palette, PanelLeft, PanelRight, diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue index 9abbaf5a1e9..35842758a3f 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue @@ -132,7 +132,7 @@ function handleFocusOutside(e: Event) { @pointer-down-outside="pointerDownOutside" > -import { ref, watch, watchEffect } from 'vue'; +import { ref, useTemplateRef, watch, watchEffect } from 'vue'; import { usePagination } from '@vben/hooks'; -import { Grip, Package2 } from '@vben/icons'; +import { EmptyIcon, Grip } from '@vben/icons'; import { Button, Pagination, @@ -38,9 +38,9 @@ const emit = defineEmits<{ 'update:value': [string]; }>(); +const refTrigger = useTemplateRef('refTrigger'); const currentSelect = ref(''); const currentList = ref(props.icons); -const refTrigger = ref(); watch( () => props.icons, @@ -50,7 +50,7 @@ watch( { immediate: true }, ); -const { getPaginationList, getTotal, setCurrentPage } = usePagination( +const { paginationList, total, setCurrentPage } = usePagination( currentList, props.pageSize, ); @@ -75,47 +75,57 @@ const handlePageChange = (page: number) => { setCurrentPage(page); }; -const changeOpenState = () => { - if (refTrigger.value) { - refTrigger.value.click(); - } -}; +function changeOpenState() { + refTrigger.value?.click?.(); +} defineExpose({ changeOpenState });