Browse Source

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

main
xingyu 2 years ago
parent
commit
f2a54807e8
  1. 3
      src/components/Button/src/BasicButton.vue

3
src/components/Button/src/BasicButton.vue

@ -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 || {}" />