Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/plugins/features/nprogress.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ icon: pajamas:progress

<NpmBadge package="@vuepress/plugin-nprogress" />

Integrate [nprogress](https://github.com/rstacruz/nprogress) into VuePress, which can provide a progress bar when navigating to another page.
Integrate [nprogress](https://github.com/rstacruz/nprogress) into VuePress, which provides a progress bar when navigating to another page.

This plugin has been integrated into the default theme.

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/plugins/features/nprogress.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ icon: pajamas:progress

<NpmBadge package="@vuepress/plugin-nprogress" />

将 [nprogress](https://github.com/rstacruz/nprogress) 集成到 VuePress 中,在切换到另一个页面时会展示进度条
将 [nprogress](https://github.com/rstacruz/nprogress) 集成到 VuePress 中,在切换到另一个页面时提供进度条

该插件已经集成到默认主题中。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { nprogress } from '../nprogress.js'
import '../styles/vars.css'
import '../styles/nprogress.css'

/**
* Use nprogress
*
* 使用 nprogress
*/
export const useNprogress = (): void => {
onMounted(() => {
// get vue-router instance
Expand Down
14 changes: 14 additions & 0 deletions plugins/features/plugin-nprogress/src/node/nprogressPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ import { getDirname, path } from 'vuepress/utils'

const __dirname = import.meta.dirname || getDirname(import.meta.url)

/**
* NProgress plugin for VuePress
*
* VuePress 的 NProgress 插件
*
* @example
* ```ts
* import { nprogressPlugin } from '@vuepress/plugin-nprogress'
*
* export default {
* plugins: [nprogressPlugin()],
* }
* ```
*/
export const nprogressPlugin = (): Plugin => ({
name: '@vuepress/plugin-nprogress',

Expand Down
Loading