<!DOCTYPE html>
<html>
<head>
<title>v-bind background-color</title>
<style>
#app > div {
width: 200px;
padding: 20px;
border: dashed black 1px;
}
.myClass {
background-color: lightcoral;
}
</style>
</head>
<body>
<h1>Example</h1>
<p>'v-bind' is used to assign class with true/false.</p>
<p>The browser set the 'myClass' class on the div tag when set to 'true'.</p>
<div id="app">
<div v-bind:class="{ myClass: true }">
Importance visualized by background color
</div>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
})
app.mount('#app')
</script>
</body>
</html>