Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 05a6891

Browse files
author
Steffan
committed
update Readme
1 parent 2adbd67 commit 05a6891

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ new Vue({
6666
});
6767
```
6868

69-
### Short example
70-
Lets see how **easy** you can **watch global events** like reactive properties! (Like in this [example](https://vuejs.org/v2/examples/commits.html)).
69+
Lets see how **easy** you can **watch global events** like reactive properties! (Like in this [example](https://vuejs.org/v2/examples/commits.html)).
7170
Let's assume you have a logout button in any component template and want it to be handled *somewhere else* without these nasty `$on(...)` and `$off(...)` lines in the created and destroy hooks.
7271

7372
```html
@@ -78,17 +77,21 @@ Let's assume you have a logout button in any component template and want it to b
7877
```js
7978
// userManager.vue
8079
export default {
80+
8181
name: 'any-other-component',
82+
8283
events: {
8384
// the event name string binds the method name string
8485
'logout:the-user': 'logout'
8586
},
87+
8688
methods: {
8789
// this method will be called everytime the event occurs
88-
logout (event, param) {
90+
logout (event, param) {
8991
this.$http.post('/logout')
9092
}
9193
}
94+
9295
}
9396
```
9497

0 commit comments

Comments
 (0)