Thực đơn × × Chính xác! Bài tập:Viết mã còn thiếu để phương thức 'writeText' được gọi khi thẻ <div> được nhấp vào. <div id="app"> <p>Nhấp vào hộp bên dưới:</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) = 'Xin chào thế giới!' } } }) app.mount('#app') </script> <div id="app"> <p>Nhấp vào hộp bên dưới:</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: '' } }, phương thức: { writeText() { this.text = 'Xin chào thế giới!' } } }) app.mount('#app') </script> <div id="app"> <p>Nhấp vào hộp bên dưới:</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: '' } }, phương thức: { writeText() { this.text = 'Xin chào thế giới!' } } }) app.mount('#app') </script> <div id="app"> <p>Nhấp vào hộp bên dưới:</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: '' } }, các phương thức: { writeText() { this.text = 'Xin chào thế giới!' } } }) app.mount('#app') </script> <div id="app"> <p>Nhấp vào hộp bên dưới:</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: '' } }, các phương thức: { writeText() { this.text = 'Xin chào thế giới!' } } }) app.mount('#app') </script> Không chính xácBấm vào đây để thử lại. Chính xác!Kế tiếp ❯ |
Điều này sẽ thiết lập lại điểm của TẤT CẢ 54 bài tập.
Bạn có chắc chắn muốn tiếp tục không?