Skip to content

Commit a610d56

Browse files
committed
fix: avoid using complex :not selectors
1 parent df066c9 commit a610d56

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ export const createApp = (initialData?: any) => {
4040
}
4141

4242
el = el || document.documentElement
43-
let roots = el.hasAttribute('v-scope')
44-
? [el]
45-
: // optimize whole page mounts: find all root-level v-scope
46-
[...el.querySelectorAll(`[v-scope]:not([v-scope] [v-scope])`)]
43+
let roots: Element[]
44+
if (el.hasAttribute('v-scope')) {
45+
roots = [el]
46+
} else {
47+
roots = [...el.querySelectorAll(`[v-scope]`)].filter(
48+
(root) => !root.matches(`[v-scope] [v-scope]`)
49+
)
50+
}
4751
if (!roots.length) {
4852
roots = [el]
4953
}

0 commit comments

Comments
 (0)