mirror of
https://github.com/romancm/gamebrary
synced 2024-11-30 23:09:14 +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">
|
<template lang="html">
|
||||||
<div class="gameboard-placeholder">
|
<div class="gameboard-placeholder">
|
||||||
<div
|
<div
|
||||||
v-for="list in board.lists"
|
v-for="list in placeholderBoard.lists"
|
||||||
:class="`list ${list.settings.view || 'single'}`"
|
:class="`list ${list.settings.view || 'single'}`"
|
||||||
:key="list.name"
|
:key="list.name"
|
||||||
>
|
>
|
||||||
|
@ -35,18 +35,20 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
board: {},
|
placeholderBoard: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['boards']),
|
...mapState(['boards', 'board']),
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
const boardId = this.$route.params.id;
|
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>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue