Menu
×
×
Correct!
Exercise:Provide the correct code so that the 'isImportant' computed property is shown on the screen.
<div id="app">
<form>
<p>
Important item?
<label>
<input type="checkbox" v-model="chbxVal">
@(17)
</label>
</p>
</form>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
chbxVal: false
}
},
@(8): {
isImportant() {
if(this.chbxVal){
return 'yes'
}
else {
return 'no'
}
}
}
})
app.mount('#app')
</script>
<div id="app">
<form>
<p>
Important item?
<label>
<input type="checkbox" v-model="chbxVal">
{{ isImportant }}
</label>
</p>
</form>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
chbxVal: false
}
},
computed: {
isImportant() {
if(this.chbxVal){
return 'yes'
}
else {
return 'no'
}
}
}
})
app.mount('#app')
</script>
<div id="app">
<form>
<p>
Important item?
<label>
<input type="checkbox" v-model="chbxVal">
{{isImportant}}
</label>
</p>
</form>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
chbxVal: false
}
},
computed: {
isImportant() {
if(this.chbxVal){
return 'yes'
}
else {
return 'no'
}
}
}
})
app.mount('#app')
</script>
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 54 exercises.
Are you sure you want to continue?