Skip to content
专业版

FmSparklesText 闪耀文字

带有闪烁粒子动画效果的文字组件,文字周围会显示随机闪烁的星光。

基础用法

vue
<template>
  <FmSparklesText text="Fantastic-admin" />
</template>

自定义粒子数量

vue
<template>
  <FmSparklesText text="闪耀效果" :sparkles-count="15" />
</template>

自定义颜色

vue
<template>
  <FmSparklesText
    text="彩色星光"
    :colors="{ first: '#ff6b6b', second: '#4ecdc4' }"
  />
</template>

API

Props

参数说明类型默认值
text要显示的文字stringrequired
sparklesCount闪烁粒子数量number10
colors粒子颜色配置{ first: string, second: string }{ first: '#9E7AFF', second: '#FE8BBB' }
class自定义类名HTMLAttributes['class']undefined

示例

标题装饰

vue
<template>
  <div class="text-center py-8">
    <FmSparklesText
      text="欢迎使用"
      class="text-5xl font-bold"
      :colors="{ first: '#fbbf24', second: '#f59e0b' }"
    />
  </div>
</template>

Logo 文字效果

vue
<template>
  <FmSparklesText
    text="PRO"
    class="text-6xl font-black"
    :sparkles-count="20"
    :colors="{ first: '#8b5cf6', second: '#d946ef' }"
  />
</template>

小尺寸文字

vue
<template>
  <FmSparklesText
    text="NEW"
    class="text-sm font-bold"
    :sparkles-count="6"
  />
</template>