Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created August 10, 2021 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/e1a64e2df18119864614a79f99985c4c to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/e1a64e2df18119864614a79f99985c4c to your computer and use it in GitHub Desktop.
<script setup>
import { ref } from 'vue'
const color = ref('red')
</script>
<template>
<button @click="color = color === 'red' ? 'green' : 'red'">
Color is: {{ color }}
</button>
</template>
<style scoped>
button {
color: v-bind(color);
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment