# @globalhive/vuejs-tour 中文文档

规范地址：https://npmcn.com/package/%40globalhive/vuejs-tour/

版本：3\.0\.1
npm 元数据更新时间：2026-03-18T17:52:50.050Z
中文译文更新时间：2026-11-16T16:08:57.386Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40globalhive/vuejs-tour
原文对照：https://npmcn.com/package/%40globalhive/vuejs-tour/?lang=original
项目主页：https://globalhive.github.io/vuejs-tour/
源码仓库：https://github.com/globalhive/vuejs-tour

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：123 kB，14 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- peer 依赖：vue ^3\.5\.22
- 首次发布：2022-12-07T19:30:50.468Z
- 最新版本发布：2026-03-18T17:52:49.903Z
- 近 30 天下载量：11418（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：54（近 12 个月 4 个）

## 中文简介

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

## 安装

```sh
npm install @globalhive/vuejs-tour
```

也可以使用：`pnpm add @globalhive/vuejs-tour`、`yarn add @globalhive/vuejs-tour`、`bun add @globalhive/vuejs-tour`

## README

# VueJS 巡回赛

[![license](https://img.shields.io/github/license/globalhive/vuejs-tour)](https://github.com/GlobalHive/vuejs-tour/blob/master/LICENSE) [![docs](https://img.shields.io/github/actions/workflow/status/globalhive/vuejs-tour/docs.yml?branch=master&label=docs)](https://github.com/GlobalHive/vuejs-tour/actions/workflows/docs.yml) [![build](https://img.shields.io/github/actions/workflow/status/globalhive/vuejs-tour/npm-publish.yml?branch=master)](https://www.npmjs.com/package/@globalhive/vuejs-tour) [![open issues](https://img.shields.io/github/issues-raw/globalhive/vuejs-tour)](https://github.com/GlobalHive/vuejs-tour/issues) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/f320aadcc4514cc5aaedafd271be2fd7)](https://app.codacy.com/gh/GlobalHive/vuejs-tour/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)  
[![version](https://img.shields.io/npm/v/@globalhive/vuejs-tour)](https://www.npmjs.com/package/@globalhive/vuejs-tour) [![downloads](https://img.shields.io/npm/dt/@globalhive/vuejs-tour)](https://www.npmjs.com/package/@globalhive/vuejs-tour) [![producthunt](https://img.shields.io/badge/view_on-ProductHunt-orange)](https://www.producthunt.com/products/vuejs-tour) [![codecov](https://codecov.io/gh/GlobalHive/vuejs-tour/graph/badge.svg?token=CUET0CGLU9)](https://codecov.io/gh/GlobalHive/vuejs-tour)

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

[![](https://npmcn.com/package/%40globalhive/vuejs-tour/vuejs-tour.gif)](https://globalhive.github.io/vuejs-tour/)

## 目录

-   [先决条件](https://npmcn.com/package/%40globalhive/vuejs-tour/#readme-prerequisites)
-   [安装](https://npmcn.com/package/%40globalhive/vuejs-tour/#readme-installation)
-   [创建巡演](https://npmcn.com/package/%40globalhive/vuejs-tour/#readme-create-a-tour)
-   [文档](https://npmcn.com/package/%40globalhive/vuejs-tour/#readme-documentation)
-   [有东西不见了吗?](https://npmcn.com/package/%40globalhive/vuejs-tour/#readme-something-missing)

## 先决条件

-   [节点.js](https://nodejs.org/)
-   [Vue 3 (组合 API)](https://vuejs.org/guide/introduction.html#composition-api)

## 安装

> \[TIP\] 在找新版本吗? [Nuxt版本(特别感谢 BayBreezy)](https://github.com/BayBreezy/nuxt-tour)

## 创建巡演

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

```vue
<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` 道具...

```vue
<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()` 用于组件实例的方法.

```vue
<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 选择器](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)。 。 。 .

## 文档

关于现有道具和方法的更多信息,请查看 [文档](https://globalhive.github.io/vuejs-tour/)。 。 。 .

## 有东西不见了吗?

如果您有特性请求或发现错误, [告诉我们](https://github.com/GlobalHive/vuejs-tour/issues) 提交问题.

## 常见问题

### @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 和提交记录判断。

