File tree Expand file tree Collapse file tree 6 files changed +60
-43
lines changed Expand file tree Collapse file tree 6 files changed +60
-43
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
node_modules /
3
- dist /build .js
3
+ dist /app .js
4
4
npm-debug.log
Original file line number Diff line number Diff line change 7
7
</ head >
8
8
< body >
9
9
< div id ="app ">
10
- < select v-model ="type ">
11
- < option value ="dice "> Board Game</ option >
12
- < option value ="spades "> Card Game</ option >
13
- </ select >
14
- < input v-model ="game " @keyup.enter ="addGame ">
15
- < button @click ="addGame "> Add</ button >
16
- < p v-if ="empty "> Zarro Boords!</ p >
17
- < ul v-else >
18
- < li v-for ="g in games ">
19
- < span :class ="icon(g.type) "> </ span >
20
- {{ g.game }}
21
- </ li >
22
- </ ul >
10
+ < board-library > </ board-library >
23
11
</ div >
24
- < script src ="node_modules/vue/dist/vue.js "> </ script >
25
- < script >
26
- var app = new Vue ( {
27
- el : '#app' ,
28
- data : {
29
- game : '' ,
30
- type : 'dice' ,
31
- games : [ ]
32
- } ,
33
- computed : {
34
- empty : function ( ) {
35
- return this . games . length == 0
36
- }
37
- } ,
38
- methods : {
39
- addGame : function ( ) {
40
- this . games . push ( {
41
- game : this . game ,
42
- type : this . type
43
- } )
44
- } ,
45
- icon : function ( type ) {
46
- return 'icon-' + type
47
- }
48
- }
49
- } )
50
- </ script >
12
+ < script src ="dist/app.js "> </ script >
51
13
</ body >
52
14
</ html >
Original file line number Diff line number Diff line change 4
4
"author" : " Andy Wood <andy@ideaflip.com>" ,
5
5
"private" : true ,
6
6
"scripts" : {
7
- "watchify" : " watchify -vd -p browserify-hmr -e src/main.js -o dist/build .js" ,
7
+ "watchify" : " watchify -vd -p browserify-hmr -e src/main.js -o dist/app .js" ,
8
8
"serve" : " http-server -o -s -c 1 -a localhost" ,
9
9
"dev" : " npm-run-all --parallel watchify serve" ,
10
- "build" : " cross-env NODE_ENV=production browserify -g envify src/main.js | uglifyjs -c warnings=false -m > dist/build .js"
10
+ "build" : " cross-env NODE_ENV=production browserify -g envify src/main.js | uglifyjs -c warnings=false -m > dist/app .js"
11
11
},
12
12
"dependencies" : {
13
13
"vue" : " ^2.0.1"
26
26
"vueify" : " ^9.1.0" ,
27
27
"watchify" : " ^3.4.0"
28
28
},
29
+ "browser" : {
30
+ "vue" : " vue/dist/vue.js"
31
+ },
29
32
"browserify" : {
30
33
"transform" : [
31
34
" vueify" ,
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <select v-model =" type" >
4
+ <option value =" dice" >Board Game</option >
5
+ <option value =" spades" >Card Game</option >
6
+ </select >
7
+ <input v-model =" game" @keyup.enter =" addGame" >
8
+ <button @click =" addGame" >Add</button >
9
+ <p v-if =" empty" >Zarro Boords!</p >
10
+ <ul v-else >
11
+ <li v-for =" g in games" >
12
+ <span :class =" icon(g.type)" ></span >
13
+ {{ g.game }}
14
+ </li >
15
+ </ul >
16
+ </div >
17
+ </template >
18
+
19
+ <script >
20
+ module .exports = {
21
+ data : function () {
22
+ return {
23
+ game: ' ' ,
24
+ type: ' dice' ,
25
+ games: []
26
+ }
27
+ },
28
+ computed: {
29
+ empty : function () {
30
+ return this .games .length == 0
31
+ }
32
+ },
33
+ methods: {
34
+ addGame : function () {
35
+ this .games .push ({
36
+ game: this .game ,
37
+ type: this .type
38
+ })
39
+ },
40
+ icon : function (type ) {
41
+ return ' icon-' + type
42
+ }
43
+ }
44
+ }
45
+ </script >
Original file line number Diff line number Diff line change
1
+ var Vue = require ( 'vue' )
2
+ var BoardLibrary = require ( './BoardLibrary.vue' )
3
+
4
+ Vue . component ( 'board-library' , BoardLibrary )
5
+ var app = new Vue ( {
6
+ el : '#app'
7
+ } )
You can’t perform that action at this time.
0 commit comments