Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit d708ef3

Browse files
committed
docs: update README
1 parent c596e60 commit d708ef3

File tree

1 file changed

+48
-11
lines changed

1 file changed

+48
-11
lines changed

README.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
- [@uni-helper/uni-cloud-types](https://github.com/uni-helper/uni-cloud-types) 提供 `uni-cloud` 组件类型
99
- [@uni-helper/uni-ui-types](https://github.com/uni-helper/uni-ui-types) (当前仓库)提供 `uni-ui` 组件类型
1010

11-
基于 [这个 PR](https://github.com/vuejs/core/pull/3399)[Vue Language Features (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) 已经支持。
11+
基于 [这个 PR](https://github.com/vuejs/core/pull/3399)[Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar)(即 Volar) 已经支持。
1212

13-
安装之后,建议启用 [接管模式 Takeover Mode](https://cn.vuejs.org/guide/typescript/overview.html#volar-takeover-mode)。如果不想启用接管模式,可以安装 [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)。启用或安装后需要重启 VSCode
13+
安装之后,请参考 [这里](https://cn.vuejs.org/guide/typescript/overview.html) 配置你的 VS Code。启用或安装后需要重启 VS Code
1414

1515
维护直到官方类型推出。
1616

@@ -25,7 +25,7 @@
2525
- 安装依赖
2626

2727
```shell
28-
npm i -D @uni-helper/uni-ui-types
28+
npm i -D @uni-helper/uni-app-types @uni-helper/uni-ui-types
2929
```
3030

3131
<details>
@@ -38,15 +38,40 @@
3838
<p>请参考 <a href="https://pnpm.io/npmrc#shamefully-hoist">文档</a> 设置 <code>shamefully-hoist</code> 为 <code>true</code>。</p>
3939
</details>
4040

41-
- 配置 `tsconfig.json`,确保 `compilerOptions.types` 中含有 `@dcloudio/types``@uni-helper/uni-ui-types` `include` 包含了对应的 `vue` 文件
41+
- 配置 `tsconfig.json`,确保 `compilerOptions.types` 中含有 `@dcloudio/types``@uni-helper/uni-app-types``@uni-helper/uni-ui-types``include` 包含了对应的 `vue` 文件
4242

4343
<details>
44-
<summary>1.7.12 <= <code>Vue Language Features (Volar)</code> & <code>vue-tsc</code></summary>
44+
<summary>2.0.14 <= <code>Vue Language Features (Volar)</code> & <code>vue-tsc</code></summary>
4545

4646
```json
4747
{
4848
"compilerOptions": {
49-
"types": ["@dcloudio/types", "@uni-helper/uni-ui-types"]
49+
"types": [
50+
"@dcloudio/types",
51+
"@uni-helper/uni-app-types",
52+
"@uni-helper/uni-ui-types"
53+
]
54+
},
55+
"vueCompilerOptions": {
56+
"plugins": ["@uni-helper/uni-app-types/volar-plugin"]
57+
},
58+
"include": ["src/**/*.vue"]
59+
}
60+
```
61+
62+
</details>
63+
64+
<details>
65+
<summary>1.7.12 <= <code>Vue Language Features (Volar)</code> & <code>vue-tsc</code> <= 2.0.13</summary>
66+
67+
```json
68+
{
69+
"compilerOptions": {
70+
"types": [
71+
"@dcloudio/types",
72+
"@uni-helper/uni-app-types",
73+
"@uni-helper/uni-ui-types"
74+
]
5075
},
5176
"vueCompilerOptions": {
5277
"nativeTags": ["block", "component", "template", "slot"]
@@ -58,12 +83,16 @@
5883
</details>
5984

6085
<details>
61-
<summary>1.5.1 <= <code>Vue Language Features (Volar)</code> & <code>vue-tsc</code></summary>
86+
<summary>1.5.1 <= <code>Vue Language Features (Volar)</code> & <code>vue-tsc</code> < 1.7.12</summary>
6287

6388
```json
6489
{
6590
"compilerOptions": {
66-
"types": ["@dcloudio/types", "@uni-helper/uni-ui-types"]
91+
"types": [
92+
"@dcloudio/types",
93+
"@uni-helper/uni-app-types",
94+
"@uni-helper/uni-ui-types"
95+
]
6796
},
6897
"include": ["src/**/*.vue"]
6998
}
@@ -77,7 +106,11 @@
77106
```json
78107
{
79108
"compilerOptions": {
80-
"types": ["@dcloudio/types", "@uni-helper/uni-ui-types"]
109+
"types": [
110+
"@dcloudio/types",
111+
"@uni-helper/uni-app-types",
112+
"@uni-helper/uni-ui-types"
113+
]
81114
},
82115
"vueCompilerOptions": {
83116
"nativeTags": ["block", "component", "template", "slot"]
@@ -94,7 +127,11 @@
94127
```json
95128
{
96129
"compilerOptions": {
97-
"types": ["@dcloudio/types", "@uni-helper/uni-ui-types"]
130+
"types": [
131+
"@dcloudio/types",
132+
"@uni-helper/uni-app-types",
133+
"@uni-helper/uni-ui-types"
134+
]
98135
},
99136
"vueCompilerOptions": {
100137
"experimentalRuntimeMode": "runtime-uni-app"
@@ -135,7 +172,7 @@ import { ref } from 'vue';
135172
136173
const type = ref<UniHelper.UniBadgeType>('default');
137174
const onClick: UniHelper.UniBadgeOnClick = (event) => {
138-
...
175+
// ...
139176
};
140177
</script>
141178

0 commit comments

Comments
 (0)