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

Commit 7a83af9

Browse files
committed
feat(menu): Synchronise with mdc-web v0.30.0
1 parent 1ef3026 commit 7a83af9

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

components/Menu/Menu.vue

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<template>
22
<div
3-
class="mdc-simple-menu"
3+
class="mdc-menu"
44
:class="classes"
55
tabindex="-1"
6-
@MDCSimpleMenu:selected="onSelect"
7-
@MDCSimpleMenu:cancel="onCancel">
6+
@MDCMenu:selected="onSelect"
7+
@MDCMenu:cancel="onCancel">
88
<slot />
99
</div>
1010
</template>
1111

1212
<script>
13-
import { MDCSimpleMenu } from '@material/menu'
13+
import { MDCMenu } from '@material/menu'
1414
1515
export default {
1616
model: {
@@ -20,26 +20,25 @@ export default {
2020
props: {
2121
startOpen: {
2222
type: Boolean,
23-
required: false,
2423
default: false
2524
}
2625
},
2726
data () {
2827
return {
29-
mdcSimpleMenu: null
28+
mdcMenu: null
3029
}
3130
},
3231
computed: {
3332
classes () {
3433
return {
35-
'mdc-simple-menu--open': this.startOpen
34+
'mdc-menu--open': this.startOpen
3635
}
3736
}
3837
},
3938
mounted () {
4039
if (this.$slots.default) {
4140
this.$slots.default.map(n => {
42-
n.elm.classList.add('mdc-simple-menu__items')
41+
n.elm.classList.add('mdc-menu__items')
4342
})
4443
this.$slots.default[0].elm.setAttribute('role', 'menu')
4544
@@ -50,18 +49,18 @@ export default {
5049
})
5150
}
5251
53-
this.mdcSimpleMenu = MDCSimpleMenu.attachTo(this.$el)
54-
this.mdcSimpleMenu.open = this.open
52+
this.mdcMenu = MDCMenu.attachTo(this.$el)
53+
this.mdcMenu.open = this.open
5554
},
5655
beforeDestroy () {
57-
this.mdcSimpleMenu.destroy()
56+
this.mdcMenu.destroy()
5857
},
5958
methods: {
6059
show () {
61-
this.mdcSimpleMenu.show()
60+
this.mdcMenu.show()
6261
},
6362
hide () {
64-
this.mdcSimpleMenu.hide()
63+
this.mdcMenu.hide()
6564
},
6665
onSelect (event) {
6766
this.$emit('change', event.detail.index)

components/Menu/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ data() {
4040

4141
### Props & methods
4242

43-
| Prop | Type | Default | Required | Description |
44-
|------|------|---------|----------|-------------|
45-
| startOpen | Boolean | - | false | whether the menu should be open at start |
46-
| dense | Boolean | - | false | whether the menu entries should be densed |
47-
| twoline | Boolean | - | false | whether the menu entries should be twoline |
43+
| Prop | Type | Default | Description |
44+
|------|------|---------|-------------|
45+
| startOpen | Boolean | false | whether the menu should be open at start |
4846

4947
| Method | Description |
5048
|--------|-------------|
@@ -53,9 +51,9 @@ data() {
5351

5452
### Slots
5553

56-
| Slot | Prop dependencies | Description |
57-
|------|-------------------|-------------|
58-
| default | - | menu content (list) |
54+
| Slot | Description |
55+
|------|-------------|
56+
| default | menu content (list) |
5957

6058
## MenuAnchor
6159

0 commit comments

Comments
 (0)