vuepress-plugin-typedjs2
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

vuePress2.x 打字机效果插件

快速开始

使用npm安装

npm i vuepress-plugin-typedjs2 -D

开始使用和配置

使用方法

// config.js/ts
// 导入插件
import vuepressPluginTypedjs2 from "vuepress-plugin-typedjs2";

// 配置参数
 plugins: [
    vuepressPluginTypedjs2({
      // 对应的标签选择器
      selector: '#typed',
      // 打字内容
      strings: ["总有一个功能会让你眼前一亮🎉 ^2000", "左下角可以播放音乐喵 ♪ 💕^2000"],
      typeSpeed: 60, // 打字速度
      backSpeed: 30, // 回退速度
      loop: true, // 循环
    }),
  ],


// md文件
// vuepress-theme-hope为例
---
home: true
icon: home
title: 主页
link: /
bgImage: /assets/image/home_bg.svg
bgImageDark: /assets/image/home_bg.svg
bgImageStyle:
  background-attachment: fixed
heroFullScreen: true
heroText: 一个文档主页
tagline: <span id="typed"></span>
---

配置说明

本插件直接将typed.js封装了,可以使用 typed 的全部配置 typed

使用技巧

如果您需要暂停打字效果,请使用^+ 时间,就是在该地方停留多久,单位是毫秒

{
    strings: ["Hello ^1000 world.", "The typed npm ^2000"]
}

例子

https://sc-catch-doc.pages.dev/

Package Sidebar

Install

npm i vuepress-plugin-typedjs2

Weekly Downloads

35

Version

1.0.2

License

MIT

Unpacked Size

9.76 kB

Total Files

11

Last publish

Collaborators

  • ltxlong