mirror of
https://github.com/romancm/gamebrary
synced 2025-02-17 19:48:24 +00:00
move sortedBoards to getter
This commit is contained in:
parent
4606b34688
commit
2a82ca3a26
2 changed files with 3 additions and 6 deletions
|
@ -60,7 +60,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CreateBoard from '@/components/Board/CreateBoard';
|
import CreateBoard from '@/components/Board/CreateBoard';
|
||||||
import orderby from 'lodash.orderby';
|
|
||||||
|
|
||||||
import { mapState, mapGetters } from 'vuex';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
|
|
||||||
|
@ -77,11 +76,7 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['boards', 'platforms', 'platformNames', 'wallpapers']),
|
...mapState(['boards', 'platforms', 'platformNames', 'wallpapers']),
|
||||||
...mapGetters(['platformNames']),
|
...mapGetters(['platformNames', 'sortedBoards']),
|
||||||
|
|
||||||
sortedBoards() {
|
|
||||||
return orderby(this.boards, 'name');
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -11,6 +11,8 @@ export default {
|
||||||
return platforms.filter(({ id }) => id !== state.platform.id && gamePlatforms.includes(id));
|
return platforms.filter(({ id }) => id !== state.platform.id && gamePlatforms.includes(id));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sortedBoards: ({ boards }) => orderby(boards, 'name'),
|
||||||
|
|
||||||
filteredPlatforms: (state) => {
|
filteredPlatforms: (state) => {
|
||||||
const filterField = state.settings.platformsFilterField || null;
|
const filterField = state.settings.platformsFilterField || null;
|
||||||
const sortField = state.settings.platformsSortField || 'generation';
|
const sortField = state.settings.platformsSortField || 'generation';
|
||||||
|
|
Loading…
Add table
Reference in a new issue