File tree 2 files changed +9
-5
lines changed 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -177,12 +177,14 @@ h1 { color: red }
177
177
. slotted
178
178
) . toBe ( false )
179
179
expect (
180
- parse ( `<template>hi</template><style>:slotted(h1){color:red;}</style>` )
181
- . descriptor . slotted
180
+ parse (
181
+ `<template>hi</template><style scoped>:slotted(h1){color:red;}</style>`
182
+ ) . descriptor . slotted
182
183
) . toBe ( true )
183
184
expect (
184
- parse ( `<template>hi</template><style>::v-slotted(h1){color:red;}</style>` )
185
- . descriptor . slotted
185
+ parse (
186
+ `<template>hi</template><style scoped>::v-slotted(h1){color:red;}</style>`
187
+ ) . descriptor . slotted
186
188
) . toBe ( true )
187
189
} )
188
190
Original file line number Diff line number Diff line change @@ -237,7 +237,9 @@ export function parse(
237
237
238
238
// check if the SFC uses :slotted
239
239
const slottedRE = / (?: : : v - | : ) s l o t t e d \( /
240
- descriptor . slotted = descriptor . styles . some ( s => slottedRE . test ( s . content ) )
240
+ descriptor . slotted = descriptor . styles . some (
241
+ s => s . scoped && slottedRE . test ( s . content )
242
+ )
241
243
242
244
const result = {
243
245
descriptor,
You can’t perform that action at this time.
0 commit comments