Skip to content

Commit

Permalink
fix: use replaceWith
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Jan 5, 2025
1 parent 8589b76 commit ee88a9c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/compiler-sfc/src/style/pluginScoped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,7 @@ function rewriteSelector(
// global: replace with inner selector and do not inject [id].
// ::v-global(.foo) -> .foo
if (value === ':global' || value === '::v-global') {
let last = selector
n.nodes.forEach(_node => {
selectorRoot.insertAfter(last, _node)
last = _node
})
selectorRoot.removeChild(selector)
selector.replaceWith(...n.nodes)
return false
}
}
Expand Down

0 comments on commit ee88a9c

Please sign in to comment.