Skip to content

Commit 0db188e

Browse files
committed
fix: also update the migrator for vue 3 typescript shim
1 parent 29c9fc6 commit 0db188e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare module '*.vue' {
22
import { DefineComponent } from 'vue';
3-
const component: DefineComponent;
3+
const component: DefineComponent<{}, {}, any>;
44
export default component;
55
}

packages/@vue/cli-plugin-typescript/codemods/migrateComponentType.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ module.exports = function migrateComponentType (file, api) {
4545
// update the component type
4646
componentDecl.forEach(({ node }) => {
4747
node.id.typeAnnotation = j.tsTypeAnnotation(
48-
j.tsTypeReference(j.identifier('DefineComponent'))
48+
j.tsTypeReference(
49+
j.identifier('DefineComponent'),
50+
j.tsTypeParameterInstantiation([
51+
j.tsTypeLiteral([]),
52+
j.tsTypeLiteral([]),
53+
j.tsAnyKeyword()
54+
])
55+
)
4956
)
5057
})
5158

0 commit comments

Comments
 (0)