Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit a08936e

Browse files
committed
fix(menu): Access vue instance instead of rendered node (#126)
1 parent 5ddd679 commit a08936e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

components/menu/Menu.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ export default {
7070
updateSlot () {
7171
if (this.$slots.default) {
7272
this.$slots.default.map(n => {
73-
n.elm.classList.add('mdc-menu__items')
74-
n.elm.setAttribute('role', 'menu')
75-
n.elm.setAttribute('aria-hidden', 'true')
76-
n.componentOptions.children
77-
.filter(n => n.elm.className.indexOf('mdc-list-item') > -1)
73+
n.componentInstance.$el.classList.add('mdc-menu__items')
74+
n.componentInstance.$el.setAttribute('role', 'menu')
75+
n.componentInstance.$el.setAttribute('aria-hidden', 'true')
76+
n.componentInstance.$children
77+
.filter(n => n.$el.classList.contains('mdc-list-item'))
7878
.map(n => {
79-
n.elm.setAttribute('tabindex', '0')
80-
n.elm.setAttribute('role', 'menuitem')
79+
n.$el.setAttribute('tabindex', '0')
80+
n.$el.setAttribute('role', 'menuitem')
8181
})
8282
})
8383
}

0 commit comments

Comments
 (0)