perf: 选项显示图标

This commit is contained in:
xiaojunnuo
2024-11-30 01:57:09 +08:00
parent 7b55337c5e
commit aedc462135
54 changed files with 298 additions and 52 deletions
@@ -0,0 +1,24 @@
<template>
<a-button :loading="loading" @click="onClick">
<slot></slot>
</a-button>
</template>
<script setup lang="ts">
import { ref } from "vue";
const props = defineProps<{
click?: () => Promise<void>;
}>();
const loading = ref(false);
function onClick() {
loading.value = true;
try {
if (props.click) {
props.click();
}
} finally {
loading.value = false;
}
}
</script>