Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. new Vue({
  2. el: '#Application',
  3. router: Router,
  4. components: { 'ExampleDepartment', Application },
  5. data: function() {
  6. return {
  7.  
  8. }
  9. }
  10. });
  11.  
  12. <v-list-tile v-for="action in actions" :key="action.label" v-if="action.visibility == true">
  13. ...
  14. </v-list-tile>
  15.  
  16. export default {
  17. watch: {
  18. $route: function() {
  19. this.getOrSetPageVisibility();
  20. }
  21. },
  22.  
  23. methods: {
  24. getOrSetPageVisibility() {
  25. for(let index = 0; index < this.actions.length; index++) {
  26. if(this.actions[index].page == this.$router.currentRoute.name) {
  27. this.actions.$set(index, { visibility }, true);
  28. }
  29. }
  30. }
  31. },
  32.  
  33. data: function() {
  34. return {
  35. actions: [
  36. {
  37. label: 'Add Sample',
  38. icon: 'add_circle',
  39. page: 'Sample',
  40. visibility: false
  41. }
  42. ]
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement