X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FRules.vue;h=1702b509d1408f929f2bce29afd5cb1f7881593a;hb=24340cae41e916d91088cc6988d8838b342a9c42;hp=2cfd3318400591973cffa38329e8711a512a0a87;hpb=a6b9b86c580cefd81a930116f7e86610ece99887;p=vchess.git diff --git a/client/src/views/Rules.vue b/client/src/views/Rules.vue index 2cfd3318..1702b509 100644 --- a/client/src/views/Rules.vue +++ b/client/src/views/Rules.vue @@ -10,8 +10,8 @@ button(v-show="gameInProgress" @click="stopGame") | Stop game div(v-show="display=='rules'" v-html="content" class="section-content") - Game(v-show="display=='computer'" :mycolor="mycolor" :fen="fen" - :mode="mode" :sub-mode="subMode" + Game(v-show="display=='computer'" :mycolor="mycolor" :gid-or-fen="fen" + :mode="mode" :sub-mode="subMode" :variant="variant" @computer-think="gameInProgress=false" @game-over="stopGame") @@ -20,9 +20,13 @@ import Game from "@/components/Game.vue"; import { store } from "@/store"; export default { name: 'my-rules', + components: { + Game, + }, data: function() { return { st: store.state, + variant: null, content: "", display: "rules", mode: "computer", @@ -32,6 +36,11 @@ export default { fen: "", }; }, + created: function() { + const vname = this.$route.params["vname"]; + const idxOfVar = this.st.variants.indexOf(e => e.name == vname); + this.variant = this.st.variants[idxOfVar]; + }, mounted: function() { // Method to replace diagrams in loaded HTML const replaceByDiag = (match, p1, p2) => {