Skip to content

Commit 9a7357a

Browse files
authored
fix: fix getting shadow root when component is functional (#1560)
1 parent 032d56b commit 9a7357a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: lib/runtime/componentNormalizer.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ export default function normalizeComponent (
6262
options._ssrRegister = hook
6363
} else if (injectStyles) {
6464
hook = shadowMode
65-
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
65+
? function () {
66+
injectStyles.call(
67+
this,
68+
(options.functional ? this.parent : this).$root.$options.shadowRoot
69+
)
70+
}
6671
: injectStyles
6772
}
6873

0 commit comments

Comments
 (0)