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中的指令</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
     <p v-if="seen">是否能够看到我?</p>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                //切换true or false 来设置
                seen:false
            }
        })
    </script>
</body>
</html>