This repository has been archived by the owner on Nov 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(menu): update to mdc-web v3.1.0 (#388)
* feat(menu): update to mdc-web v3.1.0 * test(menu): add snapshots
- Loading branch information
1 parent
04e8c90
commit 8e6734e
Showing
12 changed files
with
419 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<ul class="mdc-menu__selection-group"> | ||
<slot /> | ||
</ul> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
slotObserver: undefined | ||
} | ||
}, | ||
mounted () { | ||
this.$nextTick(() => { | ||
this.updateSlot() | ||
this.slotObserver = new MutationObserver(() => this.updateSlot()) | ||
this.slotObserver.observe(this.$el, { | ||
childList: true, | ||
subtree: true | ||
}) | ||
}) | ||
}, | ||
methods: { | ||
updateSlot () { | ||
if (this.$slots.default) { | ||
this.$slots.default.forEach(n => { | ||
if (n.elm instanceof Element && n.elm.classList.contains('mdc-list-item')) { | ||
n.elm.querySelector('.mdc-list-item__graphic').classList.add('mdc-menu__selection-group-icon') | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.