projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reactivate game component, think about web(pack) worker
[vchess.git]
/
client
/
src
/
views
/
Rules.vue
diff --git
a/client/src/views/Rules.vue
b/client/src/views/Rules.vue
index
2cfd331
..
1702b50
100644
(file)
--- 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")
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")
</template>
@computer-think="gameInProgress=false" @game-over="stopGame")
</template>
@@
-20,9
+20,13
@@
import Game from "@/components/Game.vue";
import { store } from "@/store";
export default {
name: 'my-rules',
import { store } from "@/store";
export default {
name: 'my-rules',
+ components: {
+ Game,
+ },
data: function() {
return {
st: store.state,
data: function() {
return {
st: store.state,
+ variant: null,
content: "",
display: "rules",
mode: "computer",
content: "",
display: "rules",
mode: "computer",
@@
-32,6
+36,11
@@
export default {
fen: "",
};
},
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) => {
mounted: function() {
// Method to replace diagrams in loaded HTML
const replaceByDiag = (match, p1, p2) => {