Skip to content

Commit

Permalink
fix: fix getting shadow root when component is functional (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrh122 committed May 1, 2020
1 parent 032d56b commit 9a7357a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/runtime/componentNormalizer.js
Expand Up @@ -62,7 +62,12 @@ export default function normalizeComponent (
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}

Expand Down

0 comments on commit 9a7357a

Please sign in to comment.