Some debug, all components enabled (but not finished: socket+AJAX missing)
[vchess.git] / public / javascripts / components / tabGames.js
CommitLineData
60d9063f
BA
1// "My" games: tabs my archived local games, my correspondance games
2// + my imported games (of any type).
3// TODO: later, also add possibility to upload a game (parse PGN).
4Vue.component("my-tab-games", {
5 props: ["settings"],
6 data: function() {
7 return {
8 display: "",
9 imported: [],
10 local: [],
11 corr: []
12 };
13 },
14 template: `
15 <div>
16 <div class="button-group">
17 <button @click="display='local'">Local games</button>
18 <button @click="display='corr'">Correspondance games</button>
19 <button @click="display='imported'">Imported games</button>
20 </div>
21 <my-game-list v-show="display=='local'" :games="local">
22 </my-game-list>
23 <my-game-list v-show="display=='corr'" :games="corr">
24 </my-game-list>
25 <my-game-list v-show="display=='imported'" :games="imported">
26 </my-game-list>
27 </div>
28 `,
29 created: function() {
30 // TODO: fetch corr games, local and corr
31 // if any corr game where it's my turn, set display = "corr",
32 // else set display = "local" (if any) or imported (if any and no local)
33 },
34 methods: {
35 update: function() {
36 // TODO: scan local + imported games, if any new then add it
37 },
38 },
39});