Created
August 24, 2018 19:21
-
-
Save kapillamba4/a22093a1b4c3032a06908b5928cb5067 to your computer and use it in GitHub Desktop.
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
EXPRESSIONS | |
<div id="app"> | |
<p>I have a {{ product }}</p> | |
<p>{{ product + 's' }}</p> | |
<p>{{ isWorking ? 'YES' : 'NO' }}</p> | |
<p>{{ product.getSalePrice() }}</p> | |
</div> | |
DIRECTIVES | |
#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" > | |
v-model.lazy="..." #Syncs input after change event | |
v-model.number="..." #Always returns a number | |
v-model.trim="..." #Strips whitespace | |
LIST RENDERING | |
<li v-for="item in items" :key="item.id"> | |
{{ item }} | |
</li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment