Skip to content

Commit cb53b6f

Browse files
committed
feat(language-core): support <script vapor>
1 parent 5b01795 commit cb53b6f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/language-core/lib/utils/parseSfc.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function parse(source: string): SFCParseResult {
4949
break;
5050
case 'script':
5151
const scriptBlock = createBlock(node, source) as SFCScriptBlock;
52-
const isSetup = !!scriptBlock.attrs.setup;
52+
const isSetup = !!scriptBlock.setup;
5353
if (isSetup && !descriptor.scriptSetup) {
5454
descriptor.scriptSetup = scriptBlock;
5555
break;
@@ -129,8 +129,11 @@ function createBlock(node: ElementNode, source: string) {
129129
};
130130
}
131131
}
132-
else if (type === 'script' && p.name === 'setup') {
133-
block.setup = attrs.setup;
132+
else if (
133+
type === 'script'
134+
&& (p.name === 'setup' || p.name === 'vapor')
135+
) {
136+
block.setup = attrs[p.name];
134137
}
135138
}
136139
});

0 commit comments

Comments
 (0)