Skip to content

Commit

Permalink
Useless getters were removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Boriskin authored and Alexander Boriskin committed May 17, 2018
1 parent 1319332 commit 8333be1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
9 changes: 7 additions & 2 deletions src/components/layout/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="layout" :class="classObject" v-resize>
<app-navbar :value="opened"></app-navbar>
<app-navbar :value="opened" :triggerFunc="toggleSidebar"></app-navbar>
<sidebar></sidebar>
<div class="content-wrap" id="content-wrap">
<main id="content" class="content" role="main">
Expand All @@ -16,7 +16,7 @@
</template>

<script>
import {mapGetters} from 'vuex'
import {mapGetters, mapActions} from 'vuex'
import AppNavbar from './app-navbar/AppNavbar'
import Sidebar from './sidebar/Sidebar'
Expand All @@ -42,6 +42,11 @@
default: true
}
},
methods: {
...mapActions([
'toggleSidebar'
])
},
computed: {
...mapGetters([
'sidebarOpened',
Expand Down
16 changes: 6 additions & 10 deletions src/components/layout/app-navbar/AppNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
</template>

<script>
import {mapActions} from 'vuex'
import VuesticNavbar from '../../../vuestic-theme/vuestic-components/vuestic-navbar/VuesticNavbar'
import HeaderLogo from './components/HeaderLogo'
import HeaderSelector from './components/HeaderSelector'
Expand All @@ -49,6 +48,10 @@
value: {
type: Boolean,
required: true
},
triggerFunc: {
type: Function,
required: true
}
},
Expand Down Expand Up @@ -103,21 +106,14 @@
valueProxy: {
get () {
if (this.value === true) {
this.toggleSidebar(this.value)
this.triggerFunc(this.value)
}
return this.value
},
set (value) {
console.log(value)
this.toggleSidebar(value)
this.triggerFunc(value)
},
}
},
methods: {
...mapActions([
'toggleSidebar'
])
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
display: flex;
justify-content: center;
align-items: center;
i:hover {
cursor: pointer;
}
}
</style>

0 comments on commit 8333be1

Please sign in to comment.