Browse Source

fix: FTButton增加size

feature/three
guoapeng 3 months ago
parent
commit
dffccd3fd6
  1. 44
      src/components/common/FTButton/index.vue

44
src/components/common/FTButton/index.vue

@ -1,23 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
const props = defineProps({
type: {
type: String,
default: 'default',
},
disabled: {
type: Boolean,
default: false,
},
loading: { // loading
type: Boolean,
default: false,
},
clickHandle: {
type: Function,
required: false,
},
interface FTButton {
type?: 'default' | 'primary' | 'info'
size?: 'small' | 'default' | 'large'
disabled?: boolean
loading?: boolean
clickHandle?: () => any
}
const props = withDefaults(defineProps<FTButton>(), {
type: 'default',
size: 'default',
disabled: false,
loading: false,
clickHandle: () => {},
}) })
const isLoading = ref(false) const isLoading = ref(false)
@ -50,6 +47,7 @@ defineExpose({
<div <div
class="my-button" :class="{ class="my-button" :class="{
[`my-button-${type}`]: true, [`my-button-${type}`]: true,
[`my-button-${size}`]: true,
'button-disabled': disabled || isLoading, // loading 'button-disabled': disabled || isLoading, // loading
}" }"
> >
@ -98,6 +96,18 @@ defineExpose({
.button-disabled { .button-disabled {
opacity: 0.5; opacity: 0.5;
} }
.my-button-small {
height: 25px;
font-size: 12px;
padding: 3px 15px;
.el-icon {
position: absolute;
left: 3px;
svg {
width: 25px;
}
}
}
.my-button-default { .my-button-default {
background: #fff; background: #fff;
color: $primary-color; color: $primary-color;

Loading…
Cancel
Save