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.

Directives<br />

<strong>Vue</strong>'s directives are special HTML attributes with the v- prefix, for example, v-if,<br />

which provide a simple way to add functionality to our templates. Some<br />

examples of directives you can add to an element are:<br />

v-if: Conditionally render the element<br />

v-for: Render the element multiple times based on an array or object<br />

v-bind: Dynamically bind an attribute of the element to a JavaScript<br />

expression<br />

v-on: Attach an event listener to the element<br />

There are more that we will explore throughout the book.

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

Saved successfully!

Ooh no, something went wrong!