<template>
  <a-drawer
    title="创建任务"
    cancel-text="取消"
    ok-text="创建任务"
    placement="right"
    v-model:visible="showDriwer"
    @after-visible-change="showDriwerChange"
    width="480px"
    class="rounded-left"
  >
  </a-drawer>
</template>

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

const showDriwer = ref(false);

// 暴露方法给父组件
const showDrawer = () => {
  showDriwer.value = true;
};

const showDriwerChange = (visible: boolean) => {
  console.log('Drawer visible: ', visible);
};

// 使用defineExpose暴露方法
defineExpose({
  showDrawer
});
</script>