feat: add Surface, Link and Spinner components
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { IconLoader2 } from "@tabler/icons-vue";
|
||||
import { IconPaperclip } from "@tabler/icons-vue";
|
||||
import { ref, onBeforeUnmount } from "vue";
|
||||
import { Button } from "@heroui-vue/components";
|
||||
import { Button, Spinner } from "@heroui-vue/components";
|
||||
const isLoading = ref(false),
|
||||
message = ref("");
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
@@ -20,16 +19,7 @@ onBeforeUnmount(() => clearTimeout(timer));
|
||||
<template>
|
||||
<div class="upload-demo">
|
||||
<Button :is-pending="isLoading" @click="upload">
|
||||
<span
|
||||
v-if="isLoading"
|
||||
data-slot="spinner"
|
||||
class="inline-flex size-4 shrink-0"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<IconLoader2
|
||||
class="size-full animate-spin motion-reduce:animate-none"
|
||||
/>
|
||||
</span>
|
||||
<Spinner v-if="isLoading" color="current" size="sm" />
|
||||
<IconPaperclip v-else aria-hidden="true" />
|
||||
{{ isLoading ? "上传中…" : "上传文件" }}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user