Skip to content

Commit d2ae6b7

Browse files
author
Guillaume Chau
committed
Fix error on Firefox
1 parent a0098ca commit d2ae6b7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

shells/dev/target/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ new Vue({
3434

3535
// custom element instance
3636
const ce = document.querySelector('#shadow')
37-
const shadowRoot = ce.attachShadow({ mode: 'open' })
37+
if (ce.attachShadow) {
38+
const shadowRoot = ce.attachShadow({ mode: 'open' })
3839

39-
const ceVM = new Vue({
40-
name: 'Shadow',
41-
render (h) {
42-
return h('h2', 'Inside Shadow DOM!')
43-
}
44-
}).$mount()
40+
const ceVM = new Vue({
41+
name: 'Shadow',
42+
render (h) {
43+
return h('h2', 'Inside Shadow DOM!')
44+
}
45+
}).$mount()
4546

46-
shadowRoot.appendChild(ceVM.$el)
47+
shadowRoot.appendChild(ceVM.$el)
48+
}

0 commit comments

Comments
 (0)