update examples

This commit is contained in:
Evan You 2015-10-13 12:22:10 -04:00
parent de6459f8d6
commit 285d4ae1f7
3 changed files with 8 additions and 8 deletions

View File

@ -31,9 +31,10 @@ var demo = new Vue({
created: function () {
this.fetchData()
this.$watch('currentBranch', function () {
this.fetchData()
})
},
watch: {
currentBranch: 'fetchData'
},
filters: {

View File

@ -59,8 +59,7 @@ var app = new Vue({
// methods
methods: {
addUser: function (e) {
e.preventDefault()
addUser: function () {
if (this.isValid) {
Users.push(this.newUser)
this.newUser.name = ''

View File

@ -10,12 +10,12 @@
<body>
<div id="app">
<ul>
<li class="user" v-for="user in users" v-transition>
<li class="user" v-for="user in users" transition>
<span>{{user.name}} - {{user.email}}</span>
<button v-on="click:removeUser(user)">X</button>
<button v-on:click="removeUser(user)">X</button>
</li>
</ul>
<form id="form" v-on="submit:addUser">
<form id="form" v-on:submit.prevent="addUser">
<input v-model="newUser.name">
<input v-model="newUser.email">
<input type="submit" value="Add User">