diff --git a/packages/@vue/cli-plugin-typescript/generator/template/src/shims.d.ts b/packages/@vue/cli-plugin-typescript/generator/template/src/shims.d.ts index 8f6f410263..b01561bb4a 100644 --- a/packages/@vue/cli-plugin-typescript/generator/template/src/shims.d.ts +++ b/packages/@vue/cli-plugin-typescript/generator/template/src/shims.d.ts @@ -1,4 +1,17 @@ +import Vue, { VNode } from 'vue' + declare module '*.vue' { - import Vue from 'vue'; - export default Vue; + export default Vue +} + +declare global { + namespace JSX { + // tslint:disable no-empty-interface + interface Element extends VNode {} + // tslint:disable no-empty-interface + interface ElementClass extends Vue {} + interface IntrinsicElements { + [elem: string]: any + } + } } diff --git a/packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json b/packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json index 89d9c4c210..bb03e5ec6b 100644 --- a/packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json +++ b/packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json @@ -29,8 +29,10 @@ }, "include": [ "src/**/*.ts", + "src/**/*.tsx", "src/**/*.vue", - "tests/**/*.ts" + "tests/**/*.ts", + "tests/**/*.tsx" ], "exclude": [ "node_modules"