Vue Directives Flashcards
what is a directive
place holder
How do you add String data to vue.
Updates the element’s textContent. If you need to update the part of textContent, you should use {{ Mustache }} interpolations.
<span></span>
<span>{{msg}}</span>
how to show raw html
v-html
<div></div>
How to toggle an elements deisplay css property
v-show
provide an if statmement
v-if
provide an else statement
v-else
provide an else if
v-else-if
how to create a for loop
v-for=”item in items”
note use :key=”item.id”
something unique to iterate over
note should extend this
How do you attach and event listener to an element.
v-on:
shorthand … @
How do you bind an attribute or component to an expression
v-bind
shortand…. :
create a two way binding on a form of input
v-model
How do you denote a named slot that expect to receive props
v-slot
shorthand…. #
displaying raw mustache tags.
v-pre
This directive will remain on the element until the associated Vue instance finishes compilation.
v-cloak
Render the element and component once only.
v-once