Answers for "vuejs pass variable to css"

1

vuejs pass variable to css

<template>
<div>
  <div class="text">hello</div>
</div>
</template>

<script>
export default {
    data() {
        return {
            color: 'red',
        }
    }
}
</script>

<style>
.text {
    color: v-bind(color);
}
</style>
Posted by: Guest on July-21-2021

Code answers related to "vuejs pass variable to css"

Code answers related to "Javascript"

Browse Popular Code Answers by Language