CatalogList: simplify using mapState

This commit is contained in:
Seth Ladygo
2019-05-22 01:58:37 -07:00
parent 1e9547c4a4
commit 24903754a1
2 changed files with 10 additions and 33 deletions

View File

@ -215,7 +215,7 @@
</template>
<script>
import { mapActions } from 'vuex'
import { mapState, mapActions } from 'vuex'
import PDFProgress from './PDFProgress'
export default {
@ -225,6 +225,7 @@ export default {
data: () => ({
activeTab: null,
search: '',
interval: null,
myHeaders: [
{
text: '',
@ -299,24 +300,15 @@ export default {
width: '50px',
},
],
interval: null,
}),
computed: {
myCatalogs() {
return this.$store.getters.getMyCatalogs
},
loadingMyCatalogs() {
return this.$store.getters.getLoadingMyCatalogs
},
publicCatalogs() {
return this.$store.getters.getPublicCatalogs
},
loadingPublicCatalogs() {
return this.$store.getters.getLoadingPublicCatalogs
},
selectedCatalog() {
return this.$store.getters.getSelectedCatalog
},
...mapState([
'myCatalogs',
'loadingMyCatalogs',
'publicCatalogs',
'loadingPublicCatalogs',
'selectedCatalog',
]),
},
methods: {
...mapActions([
@ -324,7 +316,7 @@ export default {
'loadMyCatalogs',
'loadPublicCatalogs',
]),
selectCatalog: function(id) {
selectCatalog(id) {
this.setSelectedCatalog(id)
},
},