Skip to content

Commit f1511ac

Browse files
mojodnapimlie
authored andcommitted
fix: ensure hasAttribute exists on $root.$el
If ...$el is a comment node (which appears to happen during initialization under some circumstances), it will be truthy but won't have `hasAttribute`.
1 parent 877f765 commit f1511ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/mixin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function createMixin(Vue, options) {
7979
ensuredPush(this.$options, 'beforeMount', () => {
8080
// if this Vue-app was server rendered, set the appId to 'ssr'
8181
// only one SSR app per page is supported
82-
if (this.$root.$el && this.$root.$el.hasAttribute('data-server-rendered')) {
82+
if (this.$root.$el && this.$root.$el.hasAttribute && this.$root.$el.hasAttribute('data-server-rendered')) {
8383
this.$root._vueMeta.appId = 'ssr'
8484
}
8585
})

0 commit comments

Comments
 (0)