Skip to content

Commit d89d27d

Browse files
committed
refactor(plugin-nprogress): add jsdoc
1 parent 3fb92d3 commit d89d27d

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

docs/plugins/features/nprogress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ icon: pajamas:progress
66

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

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

1111
This plugin has been integrated into the default theme.
1212

docs/zh/plugins/features/nprogress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ icon: pajamas:progress
66

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

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

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

plugins/features/plugin-nprogress/src/client/composables/useNprogress.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import { nprogress } from '../nprogress.js'
55
import '../styles/vars.css'
66
import '../styles/nprogress.css'
77

8+
/**
9+
* Use nprogress
10+
*
11+
* 使用 nprogress
12+
*/
813
export const useNprogress = (): void => {
914
onMounted(() => {
1015
// get vue-router instance

plugins/features/plugin-nprogress/src/node/nprogressPlugin.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ import { getDirname, path } from 'vuepress/utils'
33

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

6+
/**
7+
* NProgress plugin for VuePress
8+
*
9+
* VuePress 的 NProgress 插件
10+
*
11+
* @example
12+
* ```ts
13+
* import { nprogressPlugin } from '@vuepress/plugin-nprogress'
14+
*
15+
* export default {
16+
* plugins: [nprogressPlugin()],
17+
* }
18+
* ```
19+
*/
620
export const nprogressPlugin = (): Plugin => ({
721
name: '@vuepress/plugin-nprogress',
822

0 commit comments

Comments
 (0)