File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
packages/docs/zh/guide/advanced Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -58,17 +58,15 @@ router.beforeEach((to, from) => {
58
58
59
59
## TypeScript
60
60
61
- <!-- TODO: translation -->
62
-
63
- It is possible to type the meta field by extending the ` RouteMeta ` interface from ` vue-router ` :
61
+ 也可以继承来自 ` vue-router ` 中的 ` RouteMeta ` 来为 meta 字段添加类型:
64
62
65
63
``` ts
66
- // This can be directly added to any of your `.ts` files like `router.ts`
67
- // It can also be added to a `.d.ts` file. Make sure it's included in
68
- // project's tsconfig.json "files"
64
+ // 这段可以直接添加到你的任何 `.ts` 文件中,例如 `router.ts`
65
+ // 也可以添加到一个 `.d.ts` 文件中。确保这个文件包含在
66
+ // 项目的 ` tsconfig.json` 中的 "file" 字段内。
69
67
import ' vue-router'
70
68
71
- // To ensure it is treated as a module, add at least one `export` statement
69
+ // 为了确保这个文件被当作一个模块,添加至少一个 `export` 声明
72
70
export {}
73
71
74
72
declare module ' vue-router' {
You can’t perform that action at this time.
0 commit comments