image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue.js中条件判断语句 v-if 指令</title>
    <script src="//static.gzj2001.com/vue/vue.js"></script>
</head>

<body>
    <div id="app">
     你好   <div v-if="seen">你能看到我</div> 

     <div v-if="ok">
         这里是true
     </div>
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                seen: false,
                ok:true

            }
        })
    </script>
</body>

</html>