Blogger Information
Blog 26
fans 0
comment 1
visits 10528
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
实例演示列表渲染与条件渲染指令
P粉751989631
Original
389 people have browsed it

实例演示列表渲染与条件渲染指令

  1. <body>
  2. <div class="app">
  3. <p v-if="flag">{{message}}</p>
  4. <button @click="flag = !flag" v-text="flag? '男的':'女的'"></button>
  5. </div>
  6. <script>
  7. Vue.createApp({
  8. data() {
  9. return {
  10. message: "前面的人是?",
  11. flag: true,
  12. };
  13. },
  14. }).mount(".app");
  15. </script>
  16. </body>

运行结果

将true改成false,显示如下:

运行结果

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post