This repository was archived by the owner on Jan 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 compileStyleAsync ,
1313 compileTemplate ,
1414 parse ,
15+ compileScript ,
1516 SFCBlock ,
1617 SFCDescriptor ,
1718 SFCTemplateCompileOptions ,
@@ -152,6 +153,9 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
152153 compilerOptions : {
153154 ...options . compilerOptions ,
154155 scopeId : hasScoped ? `data-v-${ query . id } ` : undefined ,
156+ bindingMetadata : descriptor . script
157+ ? descriptor . script . bindings
158+ : undefined ,
155159 } ,
156160 transformAssetUrls : options . transformAssetUrls ,
157161 } )
@@ -351,7 +355,6 @@ function parseSFC(
351355 sourceMap : true ,
352356 filename : id ,
353357 sourceRoot : sourceRoot ,
354- pad : 'line' ,
355358 } )
356359
357360 cache . set ( id , descriptor )
@@ -447,7 +450,8 @@ function getTemplateCode(
447450
448451function getScriptCode ( descriptor : SFCDescriptor , resourcePath : string ) {
449452 let scriptImport = `const script = {}`
450- if ( descriptor . script ) {
453+ if ( descriptor . script || descriptor . scriptSetup ) {
454+ descriptor . script = compileScript ( descriptor )
451455 const src = descriptor . script . src || resourcePath
452456 const attrsQuery = attrsToQuery ( descriptor . script . attrs , 'js' )
453457 const srcQuery = descriptor . script . src ? `&src` : ``
You can’t perform that action at this time.
0 commit comments