@globalhive/vuejs-tour

中文文档
3.0.1发布于 2026/03/19MITTypeScriptESM + CJS近 30 天下载 1.1万

武杰斯语Name Tour是一个轻量级,简单而可定制的Tour插件. 它为引导您的用户通过应用程序提供了快速而简单的方式.

中文使用文档
文档目录7 节
  1. 目录
  2. 先决条件
  3. 安装
  4. 创建巡演
  5. 开始巡演
  6. 文档
  7. 有东西不见了吗?

VueJS 巡回赛

license docs build open issues Codacy Badge
version downloads producthunt codecov

武杰斯语Name Tour是一个轻量级,简单而可定制的Tour插件. 它为引导您的用户通过应用程序提供了快速而简单的方式.

目录

先决条件

安装

[TIP] 在找新版本吗? Nuxt版本(特别感谢 BayBreezy)

创建巡演

在您的应用程序中加入 VueJS 旅游组件 。 建议添加到 App.vue 并使用 <script setup> 语法.

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour :steps="steps"/>
  </div>
</template>

<script setup>
const steps = [
  {
    target: '#selectByID',
    content: 'This is the first step',
  },
  {
    target: '.selectByClass',
    content: 'This is the second step, placed on the bottom of the target',
    placement: 'bottom',
  },
  {
    target: '[data-step="3"]',
    content: 'This is the third step',
  }
];
</script>

开始巡演

要开始巡演,你可以使用 autoStart 道具...

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour :steps="steps" autoStart/>
  </div>
</template>

<script setup>
const steps = [...];
</script>

...或者打电话 startTour() 用于组件实例的方法.

<template>
  <div>
    <div id="selectByID">Selected by its id 'selectByID'</div>
    <p class="selectByClass">Telected by its class 'selectByClass'</p>
    <button data-step="3">Selected by the 'data-step="3"' attribute</button>

    <VTour ref="tour" :steps="steps"/>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
const tour = ref(null);

const steps = [...];

onMounted(() => {
  tour.value.startTour();
});
</script>

这个 target 步骤对象的属性可以是任何有效的 CSS 选择器。 。 。 .

文档

关于现有道具和方法的更多信息,请查看 文档。 。 。 .

有东西不见了吗?

如果您有特性请求或发现错误, 告诉我们 提交问题.

版本与发布记录

@globalhive/vuejs-tour 共发布 54 个版本,首次发布于 2022/12/08;过去 12 个月发布了 4 个版本。

版本发布日期距今
3.0.1latest2026/03/197 个月前
3.0.02026/01/319 个月前
2.6.22026/01/179 个月前
2.6.12025/12/1810 个月前
2.6.02025/11/161 年前
2.5.02025/11/061 年前

关于 @globalhive/vuejs-tour 的常见问题

@globalhive/vuejs-tour 是什么?

武杰斯语Name Tour是一个轻量级,简单而可定制的Tour插件. 它为引导您的用户通过应用程序提供了快速而简单的方式.

如何安装 @globalhive/vuejs-tour?

在项目目录运行 npm install @globalhive/vuejs-tour,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.22)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@globalhive/vuejs-tour 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@globalhive/vuejs-tour 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@globalhive/vuejs-tour 可以商用吗?

@globalhive/vuejs-tour 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@globalhive/vuejs-tour 的下载量有多少?

根据 npm 官方下载统计,@globalhive/vuejs-tour 在 2026/10/17 – 2026/11/15 这 30 天内被下载 11,418 次,日均约 381 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@globalhive/vuejs-tour 还在维护吗?

最新版本 3.0.1 发布于 2026/03/19(7 个月前);至今共发布 54 个版本,其中过去 12 个月发布了 4 个;首次发布于 2022/12/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。