Menu
×
×
正确
<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>
不正确点击 此处 重试 正确下一题 ❯<div id="app"> <form> <p> Important item? <label> <input type="checkbox" v-model="chbxVal"></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 } }, : { isImportant() { if(this.chbxVal){ return 'yes' } else { return 'no' } } } }) app.mount('#app') </script> |