From 3d2c48733b86a03fc2e5a1f12ac3667ab0863b80 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 08 十一月 2024 01:03:56 +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