This commit is contained in:
Evan You 2014-08-31 12:38:38 -04:00
parent 5bb6dc631c
commit 90da04c175
1 changed files with 9 additions and 0 deletions

View File

@ -82,12 +82,21 @@ You can also pass in `isolated: true` to avoid inheriting a parent scope, which
},
greeting: function (msg) {
console.log(msg)
},
// can also use a string for methods
bye: 'sayGoodbye'
},
methods: {
sayGoodbye: function () {
console.log('goodbye!')
}
}
})
// -> created!
vm.$emit('greeting', 'hi!')
// -> hi!
vm.$emit('bye')
// -> goodbye!
```
- #### new option: `isolated`.