×
×
Correct!
Fill in the missing part so that Vue toggles the visibility of the <div> tag below for us, depending on the 'lightOn' boolean data property.
<div id="app">
<div id="lightDiv">
<div @(6)="lightOn"></div>
<img src="img_lightBulb.svg">
</div>
<button v-on:click=" lightOn =! lightOn ">Switch light</button>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
lightOn: false
}
}
})
app.mount('#app')
</script>
<div id="app">
<div id="lightDiv">
<div v-show="lightOn"></div>
<img src="img_lightBulb.svg">
</div>
<button v-on:click=" lightOn =! lightOn ">Switch light</button>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
lightOn: false
}
}
})
app.mount('#app')
</script>
<div id="app">
<div id="lightDiv">
<div v-if="lightOn"></div>
<img src="img_lightBulb.svg">
</div>
<button v-on:click=" lightOn =! lightOn ">Switch light</button>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
lightOn: false
}
}
})
app.mount('#app')
</script>
Not CorrectClick here to try again. Correct! |
This will reset the score of ALL 54 exercises.
Are you sure you want to continue?