Menu
×
×
正确
<div id="app">
<div v-on:click.right.prevent="changeColor"
v-bind:style="{backgroundColor:'hsl('+bgColor+',80%,80%)'}">
<p>Press right mouse button here.</p>
</div>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
bgColor: 0
}
},
methods: {
changeColor() {
this.bgColor+=50
}
}
})
app.mount('#app')
</script>
不正确点击 此处 重试 正确下一题 ❯<div id="app"> <div v-on:click.="changeColor" v-bind:style="{backgroundColor:'hsl('+bgColor+',80%,80%)'}"> <p>Press right mouse button here.</p> </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { bgColor: 0 } }, methods: { changeColor() { this.bgColor+=50 } } }) app.mount('#app') </script> |