vuejs newbie got a question, I created two components, 'hello' and 'world', when display then two in the html, only one got displayed, why? Thanks,
https://jsfiddle.net/aaoehLqe/3/
<div id="app">
<hello :msg="'test1'" />
<world :msg="'test2'" />
</div>
Using Props To Share Data From Parent To Child # VueJS props are the simplest way to share data between components. Props are custom attributes that we can give to a component. Then, in our template, we can give those attributes values and — BAM — we're passing data from a parent to a child component!
Each component can be linked by using props to pass the methods which will switch the components on triggering a certain event. Here is an example: HTML. CSS.
It is totally legal and fine to have multiple Vue instances on your page controlling different parts and pieces of it. In fact, you can even have your instances communicate with each other by storing them in variables within the global namespace.
Self closing tags are not a valid syntax. Try
<hello :msg="'test1'></hello>
<world :msg="'test2'></world>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With