Skip to content

Commit

Permalink
fix(volar): defineSlots without <script setup> (#138)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
  • Loading branch information
mtorromeo and sxzz committed Nov 7, 2022
1 parent 4e15e7c commit 73be65e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-mirrors-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-macros/volar": patch
---

fix defineSlots without <script setup>
4 changes: 2 additions & 2 deletions packages/volar/src/define-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function getTypeArg(
return node.typeArguments[0]
}

const sourceFile = sfc.scriptSetupAst!
return sourceFile.forEachChild((node) => {
const sourceFile = sfc.scriptSetupAst
return sourceFile?.forEachChild((node) => {
if (!ts.isExpressionStatement(node)) return
return getCallArg(node.expression)
})
Expand Down

0 comments on commit 73be65e

Please sign in to comment.