File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ After installing the plugin you can use the [Composition API](https://vue-compos
55
55
56
56
# TypeScript
57
57
58
- We provide an Example [ Repository] ( https://github.com/liximomo/vue-composition-api-tsx-example ) with TS and TSX support to help you start.
59
-
60
58
** This plugin requires TypeScript version >3.5.1. If you are using vetur, make sure to set ` vetur.useWorkspaceDependencies ` to ` true ` .**
61
59
62
60
To let TypeScript properly infer types inside Vue component options, you need to define components with ` createComponent ` :
@@ -76,6 +74,8 @@ const Component = {
76
74
77
75
## TSX
78
76
77
+ :rocket : An Example [ Repository] ( https://github.com/liximomo/vue-composition-api-tsx-example ) with TS and TSX support is provided to help you start.
78
+
79
79
To support TSX, create a declaration file with following content in your project.
80
80
81
81
``` ts
Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ Vue.use(VueCompositionApi);
55
55
56
56
# TypeScript
57
57
58
- 我们提供了一个配置好 TC/TSX 支持的[ 示例仓库] ( https://github.com/liximomo/vue-composition-api-tsx-example ) 来帮助你快速开始.
59
-
60
58
** 请使用最新版的 TypeScript,如果你使用了 ` vetur ` ,请将 ` vetur.useWorkspaceDependencies ` 设为 ` true ` 。**
61
59
62
60
为了让 TypeScript 正确的推导类型,我们必须使用 ` createComponent ` 来定义组件:
@@ -76,6 +74,8 @@ const Component = {
76
74
77
75
## TSX
78
76
77
+ :rocket : 这里有一个配置好 TC/TSX 支持的[ 示例仓库] ( https://github.com/liximomo/vue-composition-api-tsx-example ) 来帮助你快速开始.
78
+
79
79
要支持 TSX,请创建一个类型定义文件并提供正确的 JSX 定义。内容如下:
80
80
81
81
``` ts
You can’t perform that action at this time.
0 commit comments