2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-22 05:40:34 +03:00

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`.
This commit is contained in:
Seth Fitzsimmons
2019-06-26 11:59:02 -07:00
committed by Pim
parent 877f7650f2
commit f1511ac566
+1 -1
View File
@@ -79,7 +79,7 @@ export default function createMixin(Vue, options) {
ensuredPush(this.$options, 'beforeMount', () => {
// if this Vue-app was server rendered, set the appId to 'ssr'
// only one SSR app per page is supported
if (this.$root.$el && this.$root.$el.hasAttribute('data-server-rendered')) {
if (this.$root.$el && this.$root.$el.hasAttribute && this.$root.$el.hasAttribute('data-server-rendered')) {
this.$root._vueMeta.appId = 'ssr'
}
})