Code reorganization
[vchess.git] / client / src / views / Home.vue
CommitLineData
625022fd
BA
1<template>
2 <div class="home">
760865ac 3 <Home msg="Welcome to Your Vue.js Apppp"/>
625022fd
BA
4 </div>
5</template>
6
7<script>
8// @ is an alias to /src
9import HelloWorld from "@/components/HelloWorld.vue";
10
11export default {
12 name: "home",
13 components: {
98db2082 14 HelloWorld,
625022fd
BA
15 }
16};
17</script>
8d61fc4a
BA
18
19// Show a variant summary on index
20Vue.component('my-variant-summary', {
21 props: ['vobj','index'],
22 template: `
23 <div class="variant col-sm-12 col-md-5 col-lg-4" :id="vobj.name"
24 :class="{'col-md-offset-1': index%2==0, 'col-lg-offset-2': index%2==0}">
25 <a :href="url">
26 <h4 class="boxtitle text-center">
27 {{ vobj.name }}
28 <span class="count-players">
29 / {{ vobj.count }}
30 </span>
31 </h4>
32 <p class="description text-center">
33 {{ translate(vobj.desc) }}
34 </p>
35 </a>
36 </div>
37 `,
38 computed: {
39 url: function() {
40 return "/" + this.vobj.name;
41 },
42 },
43 methods: {
44 translate: function(text) {
45 return translations[text];
46 },
47 },
48})