feat: add Surface, Link and Spinner components

This commit is contained in:
maoyingjie
2026-10-21 13:04:06 +08:00
parent 9d40dc0ecb
commit 630963c652
52 changed files with 2683 additions and 162 deletions
+2 -12
View File
@@ -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>