File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ var demo = new Vue({
3131
3232 created : function ( ) {
3333 this . fetchData ( )
34- this . $watch ( 'currentBranch' , function ( ) {
35- this . fetchData ( )
36- } )
34+ } ,
35+
36+ watch : {
37+ currentBranch : 'fetchData'
3738 } ,
3839
3940 filters : {
Original file line number Diff line number Diff line change @@ -59,8 +59,7 @@ var app = new Vue({
5959
6060 // methods
6161 methods : {
62- addUser : function ( e ) {
63- e . preventDefault ( )
62+ addUser : function ( ) {
6463 if ( this . isValid ) {
6564 Users . push ( this . newUser )
6665 this . newUser . name = ''
Original file line number Diff line number Diff line change 1010 < body >
1111 < div id ="app ">
1212 < ul >
13- < li class ="user " v-for ="user in users " v- transition>
13+ < li class ="user " v-for ="user in users " transition >
1414 < span > {{user.name}} - {{user.email}}</ span >
15- < button v-on =" click: removeUser(user) "> X</ button >
15+ < button v-on:click =" removeUser(user) "> X</ button >
1616 </ li >
1717 </ ul >
18- < form id ="form " v-on =" submit: addUser ">
18+ < form id ="form " v-on:submit.prevent =" addUser ">
1919 < input v-model ="newUser.name ">
2020 < input v-model ="newUser.email ">
2121 < input type ="submit " value ="Add User ">
You can’t perform that action at this time.
0 commit comments