项目
在 GitHub 查看
nguyenvanduocit/vue-loading-spinner
关于
又一个使用 Vue.js 实现的加载指示器集合,包含大量加载动画
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文vue-loading-spinner
Loading spinner collection for Vue 3
Installation
bun add vue-loading-spinner
Usage
Individual components
<template>
<RotateSquare2 />
</template>
<script setup>
import { RotateSquare2 } from 'vue-loading-spinner'
</script>
Plugin (register all components globally)
import { createApp } from 'vue'
import VueLoadingSpinner from 'vue-loading-spinner'
import 'vue-loading-spinner/dist/vue-loading-spinner.css'
const app = createApp(App)
app.use(VueLoadingSpinner)
Props
All spinners accept a size prop (default '40px'). Most accept a color prop (default '#41b883'). Some accept duration, secondaryColor, or spinnerColor.
<Circle size="60px" />
<DoubleBounce size="50px" color="#3498db" duration="1.5s" />
<Hexagon size="80px" color="#e74c3c" spinner-color="#c0392b" />
Composables
useLoading
Manage loading state with async support.
<template>
<Circle v-if="isLoading" />
<button @click="fetchData">Load</button>
</template>
<script setup>
import { Circle, useLoading } from 'vue-loading-spinner'
const { isLoading, withLoading } = useLoading()
const fetchData = () => withLoading(() => fetch('/api/data'))
</script>
useSpinner / useScaledSpinner
Internal composables for building custom spinners with consistent size/scale behavior.
Available Spinners
Circle, Circle2-11, CubeShadow, Diamond, DoubleBounce, Gauge, Google, Hexagon, HourGlass, Jawn, Jumper, LetterCube, MikePad, Origami, Pencil, PingPong, Plane, RotateSquare, RotateSquare2-6, ScaleOut, Socket, SpinLine, SquareGrid, Stretch, Texture, ThreeDots, TwoCube, Wave
Development
bun install
bun run build
bun run typecheck
探索相关项目
加载中…