vue v-show

vue v-show

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    .box {
      width: 200px;
      height: 200px;
      /* 边框 */
      border: 1px solid #000;
      /* 文字居中 */
      text-align: center;
    }
  </style>

</head>



<body>

  <div id="app">
    <div class="box" v-show="flag">我是v-show控制的盒子</div>
  </div>

  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>

  <script>
    const app = new Vue({
      el: '#app',
      data: {
        flag: true,
      },

    })


  </script>

</body>

</html>

vue v-show_第1张图片

css 绘制一个矩形
css 语法不熟练

你可能感兴趣的:(web_html,javascript)