feat(BasicButton): BasicButton组件支持icon插槽

pull/38/head
xingyu 2023-10-15 17:34:14 +08:00
parent 0b3a5f2ff3
commit f2a54807e8
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@ const getBindValue = computed(() => ({ ...unref(attrs), ...props }))
: '',
}" :class="getButtonClass" @click="onClick"
>
<template #icon>
<slot name="icon" />
</template>
<template #default="data">
<Icon v-if="preIcon" :icon="preIcon" :size="iconSize" />
<slot v-bind="data || {}" />