Skip to content

Instantly share code, notes, and snippets.

@christopheragnus
Last active October 29, 2018 13:52
Show Gist options
  • Save christopheragnus/7b364714e59bb6f2a41ee04f0e13e9d8 to your computer and use it in GitHub Desktop.
Save christopheragnus/7b364714e59bb6f2a41ee04f0e13e9d8 to your computer and use it in GitHub Desktop.
Vuejs bindings
<a v-bind:href="url">...</a>
//Shorthand version
<a :href="url">...</a>
// True of false will add or remove attribute:
<button :disabled="isButtonDisabled">
//If isActive is truthy, the class 'active' will appear:
<div :class="{ active: isActive }">
// Style color set to value of activeColor:
<div :style="{ color: activeColor }">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment