<template>
<h3 v-if="flag">条件为{{flag}}时，渲染‘这是v-if’</h3>
      <h3 v-show="flag">条件为{{flag}}时，渲染h3-这是v-show</h3>
      <div v-show="flag" class="div1">div</div>
      <button type="button" @click="change">切换元素-{{flag}}</button>
</template>

<script setup lang="ts">
import {ref  } from "vue";

const flag = ref(true)
const change = ()=>{
    flag.value = !flag.value
}
</script>
