Skip to content

Commit d1554a4

Browse files
committed
docs: add tsconfig.json configuration
1 parent 39ed6d0 commit d1554a4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/introduction/getting-started.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ export default defineConfig({
4949

5050
## Typescript
5151

52+
### Configure `tsconfig.json`
53+
```json
54+
{
55+
"compilerOptions": {
56+
"jsx": "preserve",
57+
"jsxImportSource": "vue-jsx-vapor",
58+
// ...
59+
}
60+
}
61+
```
62+
63+
### Volar plugin
64+
5265
Since `vue-jsx-vapor` supports Vue directives and Vue macros, so need to install the [TS Macro](https://marketplace.visualstudio.com/items?itemName=zhiyuanzmj.vscode-ts-macro) VSCode plugin to load the `vue-jsx-vapor/volar` plugin for type support.
5366

5467
The `TS Macro` VSCode plugin will automatically loads the `vue-jsx-vapor/volar` by analyzing `vite.config.ts` and shares the user configuration of the `vue-jsx-vapor/vite` plugin, without the need to manually configure `ts-macro.config.ts`.

docs/zh/introduction/getting-started.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ export default defineConfig({
4949

5050
## Typescript
5151

52+
### 配置 `tsconfig.json`
53+
```json
54+
{
55+
"compilerOptions": {
56+
"jsx": "preserve",
57+
"jsxImportSource": "vue-jsx-vapor",
58+
// ...
59+
}
60+
}
61+
```
62+
63+
### Volar 插件
64+
5265
由于 `vue-jsx-vapor` 支持 Vue 指令和 Vue 宏,所以需要安装 [TS Macro](https://marketplace.visualstudio.com/items?itemName=zhiyuanzmj.vscode-ts-macro) 的 VSCode 插件来加载 `vue-jsx-vapor/volar` 插件, 以获得类型支持。
5366

5467
`TS Macro` 的 VSCode 会通过分析 `vite.config.ts` 来自动加载 `vue-jsx-vapor/volar` 插件并共享 `vue-jsx-vapor/vite` 插件的用户配置,无需手动配置 `ts-macro.config.ts`

0 commit comments

Comments
 (0)