From d44d8f0b47ad013c6d16f7b235b1a265506a27dc Mon Sep 17 00:00:00 2001 From: Robert Jefe Lindstaedt Date: Sun, 2 Oct 2016 12:13:26 +0200 Subject: [PATCH] add event bus example to help v1 expectations This adds an example of how to use similar behavior like with $broadcast / $dispatch in v1. The motivation comes from not using vuex immediately for shared state components. --- src/api/index.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/src/api/index.md b/src/api/index.md index 39249c2bd6..82bd64188c 100644 --- a/src/api/index.md +++ b/src/api/index.md @@ -1092,6 +1092,88 @@ type: api // -> "hi" ``` + One way of communicating with other components is establishing a lightweight event bus + attaching to the `vm.$root`. + + ```html + + + + + + + + + + + + + + + + + + + + ``` +

vm.$once( event, callback )

- **Arguments:**