#todayilearned

by @jm3 · aka John Manoogian3

Frequent, bite-size mini-milestone updates as I fast-forward merge* my front-end web development skills up to 2019 levels. Learn more

Vue template syntactic sugar

Posted at — Jun 3, 2019

Event listeners: v-on:click@click

Data binding - object syntax: v-bind:class=“{title: dog}” → :title=”dog”

The bound object doesn’t have to be inline:

data: { classObj: { active: true, ‘text-danger’: false } }

Data binding - array of props:

v-bind:class=“[cat, dog]” data: { cat: ‘active’, dog: ‘text-danger’ }