为什么我的最大页面显示不出效果,错哪了

来源:2-6 v-if, v-show与v-for指令

weixin_慕少5316304

2019-08-07 11:44

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>v-if,v-show,v-for  指令</title>

    <script src="./vue.js "></script>

</head>

<body>

<div id ="root">

    <div v-show="show">hello worla</div>

    <button @lick="handleClick"> toggle</button>


</div>

<script>

    new Vue ({

        el :"#root",

        data:{

            show:true     //false

        },

        methods :{

            handleClick :function () {

                this .show =!this .show;


            }

        }


    })

    //v-if指令  控制toggle的存在与否

    //v-show指令  控制toggle的显示与否

    //v-for指令  控制数据

</script>

</body>

</html>


写回答 关注

2回答

  • qq_慕雪9032806
    2019-08-07 15:33:05
    已采纳

    <button @click="handleClick"> toggle</button>,click拼错,前台报错

    weixin...

    真的哎 非常感谢

    2019-08-07 18:03:09

    共 1 条回复 >

  • VVVictory
    2019-08-14 15:09:01

    System.out.print


vue2.5入门

快速理解Vue编程理念上手Vue2.0开发。

146172 学习 · 655 问题

查看课程

相似问题