Skip to content

Commit 5a403f4

Browse files
committed
fix: prevent undefined error
1 parent 77fb6a3 commit 5a403f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/parseSetupScript.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export function parseSetupScript (id: string, descriptor: SFCDescriptor) {
88
const script = compileScript(descriptor, { id })
99

1010
function getValue (prop) {
11+
if (!prop?.type) {
12+
return undefined
13+
}
1114
if (prop.type.endsWith('Literal')) {
1215
return prop.value
1316
}

0 commit comments

Comments
 (0)