Adding styles conditionally

One great feature of modern web page architecture is the ability to pack tons of display logic in CSS. This means you can have a very clean and expressive HTML and still create impressive interactive pages via CSS.

Vue is particularly good at expressing relationships between HTML and CSS and allows you to encapsulate complex logic in easy-to-use functions.

In this recipe, we will explore the basics of styling with Vue.

Get Vue.js 2 Cookbook 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.