mirror of
https://github.com/romancm/gamebrary
synced 2024-11-28 06:00:22 +00:00
use state board when available in board placeholder
This commit is contained in:
parent
07d8327f45
commit
8ff82d26c4
1 changed files with 6 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
<template lang="html">
|
||||
<div class="gameboard-placeholder">
|
||||
<div
|
||||
v-for="list in board.lists"
|
||||
v-for="list in placeholderBoard.lists"
|
||||
:class="`list ${list.settings.view || 'single'}`"
|
||||
:key="list.name"
|
||||
>
|
||||
|
@ -35,18 +35,20 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
board: {},
|
||||
placeholderBoard: {},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['boards']),
|
||||
...mapState(['boards', 'board']),
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const boardId = this.$route.params.id;
|
||||
|
||||
this.board = this.boards.find(({ id }) => id === boardId);
|
||||
this.placeholderBoard = Object.keys(this.board).length > 0
|
||||
? this.board
|
||||
: this.boards.find(({ id }) => id === boardId);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue