@@ -269,7 +269,7 @@ async function genTemplateCode(
269
269
? `&src=${ descriptor . id } `
270
270
: '&src=true'
271
271
: ''
272
- const scopedQuery = hasScoped ? `&scoped=true ` : ``
272
+ const scopedQuery = hasScoped ? `&scoped=${ descriptor . id } ` : ``
273
273
const attrsQuery = attrsToQuery ( template . attrs , 'js' , true )
274
274
const query = `?vue&type=template${ srcQuery } ${ scopedQuery } ${ attrsQuery } `
275
275
const request = JSON . stringify ( src + query )
@@ -356,7 +356,8 @@ async function genStyleCode(
356
356
: '&src=true'
357
357
: ''
358
358
const directQuery = asCustomElement ? `&inline` : ``
359
- const query = `?vue&type=style&index=${ i } ${ srcQuery } ${ directQuery } `
359
+ const scopedQuery = style . scoped ? `&scoped=${ descriptor . id } ` : ``
360
+ const query = `?vue&type=style&index=${ i } ${ srcQuery } ${ directQuery } ${ scopedQuery } `
360
361
const styleRequest = src + query + attrsQuery
361
362
if ( style . module ) {
362
363
if ( asCustomElement ) {
@@ -457,7 +458,7 @@ async function linkSrcToDescriptor(
457
458
458
459
// these are built-in query parameters so should be ignored
459
460
// if the user happen to add them as attrs
460
- const ignoreList = [ 'id' , 'index' , 'src' , 'type' , 'lang' , 'module' ]
461
+ const ignoreList = [ 'id' , 'index' , 'src' , 'type' , 'lang' , 'module' , 'scoped' ]
461
462
462
463
function attrsToQuery (
463
464
attrs : SFCBlock [ 'attrs' ] ,
0 commit comments