Using v-bind on styles with Vue 3

Since I started using Vue with version 3, I don't know exactly what I missed in the other 2 versions, but the innovations in version 3 excite me.

It's nice to be able to dynamically use v-bind inside <style> tags.

For example;

<script setup>
import { ref } from "vue"

const textColor = ref('blue')

const changeColor = () => {
    textColor.value = 'red'
}
</script>

<template>
    
    <h3>phpexample.net</h3>
    <button @click="changeColor">change color</button>
    
</template>

<style>
h3 {
    color: v-bind(textColor)
}
</style>

that's it :)

Comments

There are no comments, make the firs comment