-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(app-1): 实现了md组件导入识别vue组件,并提供基础的类型声明。
- Loading branch information
Showing
10 changed files
with
149 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
vite-plugin-autogeneration-import-file/app/src/components/show-data.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<section> | ||
<h3 style="background-color: aquamarine">show-data</h3> | ||
</section> | ||
</template> |
47 changes: 47 additions & 0 deletions
47
vite-plugin-autogeneration-import-file/app/src/docs/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script setup lang="ts"> | ||
|
||
// import ComponentHelloWorld from "@/components/HelloWorld.vue"; | ||
import ShowData from "@/components/show-data.vue"; | ||
|
||
</script> | ||
|
||
# 文档 | ||
|
||
我希望在 md 文档内,使用 vue 组件。且实现语法高亮,自动提示,类型补全。 | ||
|
||
## 目前的做法 | ||
|
||
目前来说,还是比较有效的,勉强地实现组件导入。 | ||
|
||
### tsconfig.json | ||
|
||
```json | ||
{ | ||
// https://vitepress.dev/guide/using-vue#vs-code-intellisense-support | ||
"vueCompilerOptions": { | ||
"vitePressExtensions": [".md"] | ||
} | ||
} | ||
``` | ||
|
||
### .vscode\settings.json | ||
|
||
```json | ||
{ | ||
/** | ||
尝试让volar对md也提供基础的类型支持 | ||
https://github.com/vuejs/language-tools/tree/master/extensions/vscode#configs | ||
https://vitepress.dev/guide/using-vue#vs-code-intellisense-support | ||
*/ | ||
"vue.server.includeLanguages": ["vue", "markdown"] | ||
} | ||
``` | ||
|
||
<!-- 这里勉强实现了组件导入并识别 --> | ||
|
||
<ShowData></ShowData> | ||
|
||
<!-- 这里的 template 无法实现识别 --> | ||
<!-- <template> | ||
<ShowData></ShowData> | ||
</template> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters