File tree Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <li >
3
+ <span :class =" icon" ></span >
4
+ {{ name }}
5
+ </li >
6
+ </template >
7
+
8
+ <script >
9
+ module .exports = {
10
+ props: [
11
+ ' name' ,
12
+ ' type'
13
+ ],
14
+ computed: {
15
+ icon : function () {
16
+ return ' icon-' + this .type
17
+ }
18
+ }
19
+ }
20
+ </script >
Original file line number Diff line number Diff line change 8
8
<button @click =" addGame" >Add</button >
9
9
<p v-if =" empty" >Zarro Boords!</p >
10
10
<ul v-else >
11
- <li v-for =" g in games" >
12
- <span :class =" icon(g.type)" ></span >
13
- {{ g.game }}
14
- </li >
11
+ <board-game v-for =" g in games" :type =" g.type" :name =" g.game" ></board-game >
15
12
</ul >
16
13
</div >
17
14
</template >
18
15
19
16
<script >
17
+ var BoardGame = require (' ./BoardGame.vue' )
18
+
20
19
module .exports = {
21
20
data : function () {
22
21
return {
@@ -36,10 +35,10 @@ module.exports = {
36
35
game: this .game ,
37
36
type: this .type
38
37
})
39
- },
40
- icon : function (type ) {
41
- return ' icon-' + type
42
38
}
39
+ },
40
+ components: {
41
+ BoardGame: BoardGame
43
42
}
44
43
}
45
- </script >
44
+ </script >
You can’t perform that action at this time.
0 commit comments