<template>
  <h2>父组件</h2>
  <button @click="isShow = !isShow">显示组件</button>
  <hr>
  <Child v-if="isShow"></Child>
</template>

<script lang="ts">
import { defineComponent,ref } from 'vue'
import Child from "./components/Child.vue"

export default defineComponent({
  setup () {
    const isShow = ref(true)

    return {
      isShow
    }
  },
  components: {
    Child
  }
})
</script>

<style scoped>

</style>