25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Composing with components<br />

Components can be nested in other components in the same way that st<strong>and</strong>ard<br />

HTML elements can be nested. For example, component B can be a child of<br />

component A, if component A declares component B in its template:<br />

<br />

<br />

<br />

<br />

<strong>Vue</strong>.component('component-a', {<br />

template: `<br />

<br />

Hi I'm component A<br />

<br />

`<br />

});<br />

<strong>Vue</strong>.component('component-b', {<br />

template: `And I'm component B`<br />

});<br />

new <strong>Vue</strong>({<br />

el: '#app'

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!