菜单
×
×
正确!
练习编写缺失的代码,以便在点击 <div> 标签时调用 'writeText' 方法。 <div id="app"> <p>点击下面的方框:</p> <div @(10)=@(11)> {{ text }} </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { text: '' } }, @(7): { writeText() { this.@(4) = 'Hello World!' } } }) app.mount('#app') </script>
<div id="app"> <p>点击下面的方框:</p> <div v-on:click="writeText"> {{ text }} </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { text: '' } }, methods: { writeText() { this.text = 'Hello World!' } } }) app.mount('#app') </script>
<div id="app"> <p>点击下面的方框:</p> <div v-on:click='writeText'> {{ text }} </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { text: '' } }, methods: { writeText() { this.text = 'Hello World!' } } }) app.mount('#app') </script>
<div id="app"> <p>点击下面的方框:</p> <div @:click='writeText'> {{ text }} </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { text: '' } }, methods: { writeText() { this.text = 'Hello World!' } } }) app.mount('#app') </script>
<div id="app"> <p>点击下面的方框:</p> <div @:click="writeText"> {{ text }} </div> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { text: '' } }, methods: { writeText() { this.text = 'Hello World!' } } }) app.mount('#app') </script> 不正确点击此处重新尝试。 正确!下一题 ❯ |
这将重置所有 54 个练习的分数。
您确定要继续吗?