Chapter 3

Making Vue Templates

IN THIS CHAPTER

Bullet Creating HTML templates

Bullet Passing props

Bullet Including JavaScript in templates

Bullet Adding functionality with directives

Bullet Choosing what to render

Bullet Rendering with loops

Bullet Filling in the blanks with slots

Bullet Adding component style

“Simplicity is prerequisite for reliability.”

—EDSGER DIJKSTRA

JSX templates are written using HTML syntax. When Vue code is compiled, the HTML templates are converted into optimized JavaScript code. It's also possible to use JSX instead of HTML for your templates, or even to bypass writing templates altogether by writing Vue render functions directly. However, simply writing HTML is the recommended way to bind component logic with ...

Get JavaScript All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.