mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 00:14:18 +00:00
fix(@vant-cli): compilation error when using setup syntactic sugar and including subcomponents
This commit is contained in:
@@ -92,10 +92,13 @@ export async function compileSfc(filePath: string): Promise<any> {
|
||||
script += '// @ts-nocheck\n';
|
||||
}
|
||||
|
||||
let bindingMetadata;
|
||||
if (descriptor.scriptSetup) {
|
||||
script += compileScript(descriptor, {
|
||||
const { bindings, content } = compileScript(descriptor, {
|
||||
id: scopeId,
|
||||
}).content;
|
||||
});
|
||||
script += content;
|
||||
bindingMetadata = bindings;
|
||||
} else {
|
||||
script += descriptor.script!.content;
|
||||
}
|
||||
@@ -108,6 +111,9 @@ export async function compileSfc(filePath: string): Promise<any> {
|
||||
id: scopeId,
|
||||
source: template.content,
|
||||
filename: filePath,
|
||||
compilerOptions: {
|
||||
bindingMetadata,
|
||||
},
|
||||
}).code;
|
||||
|
||||
script = injectRender(script, render);
|
||||
|
Reference in New Issue
Block a user