Skip to content

Commit

Permalink
fix(framework-examples): Fix VueJS lifecycle beforeDestroy hooks (mat…
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbross authored and pgbross committed Mar 23, 2017
1 parent 73448f9 commit 0115498
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions framework-examples/vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@
</div>
<button type="button" @click="showSnackbar">Show Snackbar</button>
<snackbar event='mailSent'></snackbar>

<div>
<p>
<form-field :align-end='alignEnd'>
<checkbox v-model="showIcon" label="Show toggle" id="my-show" label-id="my-show-label"></checkbox>
<checkbox-label id="my-show-label" for="my-show" :label="showLabel"></checkbox-label>
</form-field>
</p>
</div>
<icon-toggle v-model="favorited"
v-if="showIcon"
:toggle-on="{'label': favoritedLabel, 'content': 'favorite'}"
:toggle-off="{'label': 'Add to favorites', 'content': 'favorite_border'}">
</icon-toggle>
Expand Down Expand Up @@ -95,7 +103,9 @@ export default {
alignEnd: false,
changeCount: 0,
favorited: true,
favoritedLabel: 'Remove from favorites'
favoritedLabel: 'Remove from favorites',
showIcon: true,
showLabel: 'Hide icon toggle'
}
},
components: { FormField, Checkbox, CheckboxLabel, IconToggle, Snackbar, TemporaryDrawer },
Expand Down
2 changes: 1 addition & 1 deletion framework-examples/vue/src/v-mdc-checkbox/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
});
this.foundation.init();
},
beforeUnmount () {
beforeDestroy () {
this.foundation.destroy();
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default {
});
this.foundation.init();
},
beforeUnmount () {
beforeDestroy () {
this.foundation.destroy();
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
this.foundation.init();
this.foundation.toggle(this.value);
},
beforeUnmount () {
beforeDestroy () {
this.foundation.destroy();
},
watch: {
Expand Down
2 changes: 1 addition & 1 deletion framework-examples/vue/src/v-mdc-snackbar/Snackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
this.foundation.show(data)
});
},
beforeUnmount () {
beforeDestroy () {
this.foundation.destroy();
},
methods: {
Expand Down

0 comments on commit 0115498

Please sign in to comment.