Skip to content

14 - Dynamic css values #2855

Open
Open
@geek4ctrl

Description

@geek4ctrl
// your answers
<script setup> import { ref } from "vue" const theme = ref("red") const colors = ["blue", "yellow", "red", "green"] setInterval(() => { theme.value = colors[Math.floor(Math.random() * 4)] }, 1000) </script>

hello

<style scoped> /* Modify the code to bind the dynamic color */ p { color: v-bind(theme) } </style>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions