Created
October 29, 2018 13:36
-
-
Save christopheragnus/9833b0f31e8171e7bd4e8ed6eb97735d to your computer and use it in GitHub Desktop.
Vuejs Directives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Element inserted/removed based on truthiness: | |
<p v-if="inStock">{{ product }}</p> | |
<p v-else-if="onSale">...</p> | |
<p v-else>...</p> | |
//Toggles the display: none CSS property: | |
<p v-show="showProductDetails">...</p> | |
//Two-way data binding: | |
<input v-model="firstName" > | |
//Sync input after change event | |
v-model.lazy="..." | |
// Always returns a number | |
v-model.number="..." | |
//Strips whitespace | |
v-model.trim="..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment