chore: only set slotted flag on sfc descriptor if style is scoped

This commit is contained in:
Evan You
2021-03-05 17:46:37 -05:00
parent ff4d4ec249
commit 540e26f49c
2 changed files with 9 additions and 5 deletions

View File

@@ -237,7 +237,9 @@ export function parse(
// check if the SFC uses :slotted
const slottedRE = /(?:::v-|:)slotted\(/
descriptor.slotted = descriptor.styles.some(s => slottedRE.test(s.content))
descriptor.slotted = descriptor.styles.some(
s => s.scoped && slottedRE.test(s.content)
)
const result = {
descriptor,