<template>
<div :style="cssStyleBG">
<div :style="cssStyleBtn" @click="click"></div>
</div>
<div>{
{state}}</div>
</template>
<script setup lang="ts">
import {ref,watch,onMounted,computed} from 'vue'
const isOpen = ref(false)
const state =ref('关')
const emit = defineEmits(['changeState'])
const click=()=>{
isOpen.value = !isOpen.value
state.value = isOpen.value? '开':'关'
emit('changeState',isOpen.value)
}
const props = withDefaults(defineProps<Props>(),{
backgroundColor:'red',
borderColor:'blue'
})
typ