From 78999ce1626d2a786f3a705281eeba79c2f1d6dd Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 22 十月 2024 09:32:27 +0800 Subject: [PATCH] 工艺页面缓存优化 --- src/components/Button/src/BasicButton.vue | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Button/src/BasicButton.vue b/src/components/Button/src/BasicButton.vue index 19e6dbb..b8cfcaa 100644 --- a/src/components/Button/src/BasicButton.vue +++ b/src/components/Button/src/BasicButton.vue @@ -1,5 +1,8 @@ <template> <Button v-bind="getBindValue" :class="getButtonClass" @click="onClick"> + <template #icon> + <slot name="icon"></slot> + </template> <template #default="data"> <Icon :icon="preIcon" v-if="preIcon" :size="iconSize" /> <slot v-bind="data || {}"></slot> @@ -10,14 +13,14 @@ <script lang="ts" setup> import { Button } from 'ant-design-vue'; - import { computed, unref } from 'vue'; + import { ComponentOptionsMixin, computed, unref } from 'vue'; import Icon from '@/components/Icon/Icon.vue'; import { buttonProps } from './props'; import { useAttrs } from '@vben/hooks'; defineOptions({ name: 'AButton', - extends: Button, + extends: Button as ComponentOptionsMixin, inheritAttrs: false, }); -- Gitblit v1.9.3