vue之v-clock指令

1,516 阅读1分钟
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* []表示属性 */
        /* 带有v-clock属性的元素先隐藏 */
        [v-clock]{
            display: none;
        }
    </style>
 
</head>
<body>
    <!-- v-clock阻止白屏 显示花括号的情况 -->
    <div id="app" v-clock>
        <h1>{{msg}}</h1>
        <h1>{{name}}</h1>
        <h1>{{age}}</h1>
        <h1>{{user}}</h1>
    </div>
    <script src="./vue2.6.14.js"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
                msg:"2021年11月",
                name:"crane",
                age:"120",
                user:"18888888888888888"
            }
        })
    </script>

</body>
</html>