Skip to content

Commit

Permalink
fix: change event name and document.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbross authored and pgbross committed Apr 25, 2018
1 parent 97eceaf commit e862cd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions components/drawer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ methods: {

> (\*) drawer is responsive if `drawer-type` undefined: temporary on mobile breakpoint and persistent otherwise.
| event | args | Description |
| --------- | ------- | ------------------------------------------------------- |
| `@change` | Boolean | notify v-model/listeners that drawer state has changed. |
| `@open` | | triggered on drawer open |
| `@close` | | triggered on drawer close |
| event | args | Description |
| ------------- | ------- | ------------------------------------------------------- |
| `@change` | Boolean | notify v-model/listeners that drawer state has changed. |
| `@open` | | triggered on drawer open |
| `@close` | | triggered on drawer close |
| `@vma:layout` | Boolean | notify listeners that screen layout has changed. |

### Drawer Header

Expand Down
2 changes: 1 addition & 1 deletion components/drawer/mdc-drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default {
},
onChange(event) {
this.$emit('change', event);
this.$root.$emit('_vma_:layout');
this.$root.$emit('vma:layout');
},
openDrawer() {
this.open_ = true;
Expand Down
4 changes: 2 additions & 2 deletions components/slider/mdc-slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ export default {
this.foundation.setupTrackMarker();
}
this.$root.$on('_vma_:layout', this.layout);
this.$root.$on('vma:layout', this.layout);
if (this.layoutOn) {
this.layoutOnEventSource = this.layoutOnSource || this.$root;
this.layoutOnEventSource.$on(this.layoutOn, this.layout);
}
},
beforeDestroy() {
this.$root.$off('_vma_:layout', this.layout);
this.$root.$off('vma:layout', this.layout);
if (this.layoutOnEventSource) {
this.layoutOnEventSource.$off(this.layoutOn, this.layout);
}
Expand Down

0 comments on commit e862cd7

Please sign in to comment.