9.7k

进度条 (Progress)

上一页下一页

用于显示任务完成进度的指示器,通常以进度条形式呈现。

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { Progress } from '@/components/ui/progress'

const progress = ref(13)

onMounted(() => {
  const timer = setTimeout(() => {
    progress.value = 66
  }, 500)

  return () => clearTimeout(timer)
})
</script>

<template>
  <Progress :model-value="progress" class="w-[60%]" />
</template>

安装

pnpm dlx shadcn-vue@latest add progress

使用方法

<script setup lang="ts">
import { Progress } from '@/components/ui/progress'
</script>

<template>
  <Progress :model-value="33" />
</template>