Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Vue({
- el: '#Application',
- router: Router,
- components: { 'ExampleDepartment', Application },
- data: function() {
- return {
- }
- }
- });
- <v-list-tile v-for="action in actions" :key="action.label" v-if="action.visibility == true">
- ...
- </v-list-tile>
- export default {
- watch: {
- $route: function() {
- this.getOrSetPageVisibility();
- }
- },
- methods: {
- getOrSetPageVisibility() {
- for(let index = 0; index < this.actions.length; index++) {
- if(this.actions[index].page == this.$router.currentRoute.name) {
- this.actions.$set(index, { visibility }, true);
- }
- }
- }
- },
- data: function() {
- return {
- actions: [
- {
- label: 'Add Sample',
- icon: 'add_circle',
- page: 'Sample',
- visibility: false
- }
- ]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement