vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

$broadcast is not heard in children component #418

Open PavelPolyakov opened 9 years ago

PavelPolyakov commented 9 years ago

Hi,

Could someone take a look on this jsfiddle, please.

http://jsfiddle.net/yMv7y/961/

I do instantiate app with one child component, and fire an event from the app. However, children is not able to receive it.

Any thoughts why it doesn't work?

update What we (+@crswll) have found - it's possible to make it work, if register "children" as component (and without instantiating it as new Vue). However, in this case, I am limited using el property, and forced to use <children></children> notation. Any thoughts of how to keep the el ?

Regards,

Twiknight commented 8 years ago

you should set parent property in children instead of setting children property in app(children property seems not to exist)