Skip to content

Text Scramble ​

Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码

预览 ​

Inspecting the repository

用法 ​

vue
<script setup lang="ts">
import { ButtonBase, TextScramble } from 'beui-vue'
import { shallowRef } from 'vue'
const phrases = ['Inspecting the repository', 'Running the checks', 'Preparing the update']
const index = shallowRef(0)
</script>
<template>
  <div class="scramble-demo"><TextScramble :text="phrases[index]!" /><ButtonBase variant="secondary" size="sm" @click="index = (index + 1) % phrases.length">Next phrase</ButtonBase></div>
</template>
<style scoped>.scramble-demo { display: grid; justify-items: center; gap: 2rem; } .scramble-demo > span { font: 500 clamp(.92rem, 4vw, 1.25rem)/1.3 ui-monospace, monospace; }</style>

API ​

传入 text,更新文本时字符从左至右解码。duration 单位为毫秒,glyphs 自定义扰动字符。

上游变体 ​

还原验收 ​

基于 beUI 的独立 Vue 移植,依 MIT 许可证分发。