From the course: Vue.js 2 for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Shorthand notation for faster writing

Shorthand notation for faster writing - Vue.js Tutorial

From the course: Vue.js 2 for Web Designers

Start my 1-month free trial

Shorthand notation for faster writing

- [Instructor] At this point, our little Customizer has a nicely interactive size selector. It updates data, uses it to make some visual and data updates. Generally we're looking pretty good. So lets pause and clean up our templates just a little bit more using shorthand notation for some of Vue's built-in directives. With a highly interactive web app, and I'm not saying that we're there with this one yet, but with a highly interactive web app, you're invariably going to be writing event listeners all over the place and updating attributes, classes, styles quite often. Vue has a little bit of shorthand to help you with this. Back over here in my editor. I use v-bind to update my classes here, and of course I can use that on any attributes I like. And then my event listeners all take the form of v-on, colon, and so forth. To make these easier to write, Vue lets you take off the v-bind from any of these, and you can just write colon class, or colon source, or alt, whatever it is. If you…

Contents