Skip to content

Commit 3aa3743

Browse files
troy351yyx990803
authored andcommitted
feat(typescript): improve tsx support (#1168)
1 parent 6ca86aa commit 3aa3743

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
import Vue, { VNode } from 'vue'
2+
13
declare module '*.vue' {
2-
import Vue from 'vue';
3-
export default Vue;
4+
export default Vue
5+
}
6+
7+
declare global {
8+
namespace JSX {
9+
// tslint:disable no-empty-interface
10+
interface Element extends VNode {}
11+
// tslint:disable no-empty-interface
12+
interface ElementClass extends Vue {}
13+
interface IntrinsicElements {
14+
[elem: string]: any
15+
}
16+
}
417
}

packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
},
2929
"include": [
3030
"src/**/*.ts",
31+
"src/**/*.tsx",
3132
"src/**/*.vue",
32-
"tests/**/*.ts"
33+
"tests/**/*.ts",
34+
"tests/**/*.tsx"
3335
],
3436
"exclude": [
3537
"node_modules"

0 commit comments

Comments
 (0)