Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/compiler-sfc/__tests__/compileStyle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ describe('SFC style preprocessors', () => {
}"
`)
expect(compileScoped(`.foo * { color: red; }`)).toMatchInlineSnapshot(`
".foo[data-v-test] * { color: red;
".foo *[data-v-test] { color: red;
}"
`)
})
Expand Down
7 changes: 5 additions & 2 deletions packages/compiler-sfc/src/style/pluginScoped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,11 @@ function rewriteSelector(
return false
}
}
// .foo * -> .foo[xxxxxxx] *
if (node) return
// .foo * -> .foo *[xxxxxxx]
Copy link
Member Author

@edison1105 edison1105 Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (node) {
node = n
return
}
}

if (
Expand Down