mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
perf: 选项显示图标
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user