返回 slidev
VPMenuLink.ts
根目录 / docs / .vitepress / shims / VPMenuLink.ts
1 import type { DefaultTheme } from 'vitepress/theme'
2 import type { DefineComponent } from 'vue'
3
4 // Typed stand-in for VitePress's default-theme `VPMenuLink.vue`, wired up via
5 // the `paths` entry in the root `tsconfig.json`. That component's source `.vue`
6 // files reference internal `.js` modules that ship without `.d.ts`, so letting
7 // `vue-tsc` parse them surfaces `noImplicitAny` errors from inside
8 // `node_modules`. Redirecting only TypeScript's resolution here avoids that;
9 // Vite still resolves the real component at runtime via node resolution.
10 declare const VPMenuLink: DefineComponent<{
11 item: DefaultTheme.NavItemWithLink
12 rel?: string
13 }>
14
15 export default VPMenuLink
16
16 lines TYPESCRIPT