When writing Vue applications, we have access to a variety of powerful directives that allow us to shape the way our content appears on the screen. This allows us to craft highly interactive user experiences with additions to our HTML templates. This chapter will be looking at each one of these directives in detail, as well as any shortcuts and patterns that allow us to improve our workflow.
By the end of this chapter you will have:
- Used attribute binding to conditionally change element behavior
- Investigated two-way binding with
v-model
- Conditionally displayed information with
v-if
,v-else
, andv-if-else
- Iterated over items in a collection with
v-for
- Listened to events (such as keyboard/input) with
v-on
- Used event modifiers to change the binding of a directive
- Used filters to change the view data of a binding
- Looked at how we can use shorthand syntax to save time and be more declarative