Skip to content

Commit

Permalink
fix: compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Feb 20, 2024
1 parent 639a742 commit 31bbae3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export function transformVueJsxVapor(
if (options?.compile && isJSXExpression(node)) {
let { code, preamble } = options.compile(content, { mode: 'module', inline: true })
preamble.match(/(\w+ as \w+)/g)?.forEach(s => importSet.add(s))
runtime = preamble.match(/(["'].*["'])/)![1]
runtime = preamble.match(/(["'].*["'])/)?.[1] || '"vue"'
if (content.includes('<slot ')) {
code = code.replace('_ctx', '_ctx = _getCurrentInstance().ctx')
importSet.add('getCurrentInstance as _getCurrentInstance')
Expand Down

0 comments on commit 31bbae3

Please sign in to comment.