Skip to content

Commit

Permalink
fix(compile-sfc): generate setup prop type format error (#4506)
Browse files Browse the repository at this point in the history
fix #4505
  • Loading branch information
webfansplz authored Sep 5, 2021
1 parent 0178f4e commit e6fe751
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-sfc/__tests__/compileScript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ const emit = defineEmits(['a', 'b'])
<script setup lang="ts">
const props = withDefaults(defineProps<{
foo?: string
bar?: number
baz: boolean
bar?: number;
baz: boolean;
qux?(): number
}>(), {
foo: 'hi',
Expand Down
3 changes: 2 additions & 1 deletion packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ export function compileScript(
) +
', '
} else {
res += scriptSetupSource.slice(m.start!, m.end!) + `, `
res +=
scriptSetupSource.slice(m.start!, m.typeAnnotation.end!) + `, `
}
}
}
Expand Down

0 comments on commit e6fe751

Please sign in to comment.