Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compile-sfc): generate setup prop type format error #4506

Merged
merged 4 commits into from Sep 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/compiler-sfc/__tests__/compileScript.spec.ts
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
Expand Up @@ -623,7 +623,8 @@ export function compileScript(
) +
', '
} else {
res += scriptSetupSource.slice(m.start!, m.end!) + `, `
webfansplz marked this conversation as resolved.
Show resolved Hide resolved
res +=
scriptSetupSource.slice(m.start!, m.typeAnnotation.end!) + `, `
}
}
}
Expand Down