fix(compile-sfc): generate setup prop type format error (#4506)
fix #4505
This commit is contained in:
parent
0178f4ed31
commit
e6fe751b20
@ -799,8 +799,8 @@ const emit = defineEmits(['a', 'b'])
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
foo?: string
|
foo?: string
|
||||||
bar?: number
|
bar?: number;
|
||||||
baz: boolean
|
baz: boolean;
|
||||||
qux?(): number
|
qux?(): number
|
||||||
}>(), {
|
}>(), {
|
||||||
foo: 'hi',
|
foo: 'hi',
|
||||||
|
@ -623,7 +623,8 @@ export function compileScript(
|
|||||||
) +
|
) +
|
||||||
', '
|
', '
|
||||||
} else {
|
} else {
|
||||||
res += scriptSetupSource.slice(m.start!, m.end!) + `, `
|
res +=
|
||||||
|
scriptSetupSource.slice(m.start!, m.typeAnnotation.end!) + `, `
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user