# Drawer 抽屉

继承 Antd Drawer的所有 Api,通过函数调用的方式打开抽屉

# 基本使用

<template>
  <a-button type="primary" @click="handleOpen">打开抽屉</a-button>
</template>

<script>
export default {
  methods: {
    handleOpen() {
      this.$openDrawer({
        title: '抽屉',
        content: <div>自定义组件</div>,
        onOk: this.handleClose
      });
    },
    handleClose() {
      console.log('点击确定,抽屉关闭了');
    }
  }
};
</script>
显示代码 复制代码

# 属性

参数 说明 类型 默认值
content 自定义组件 VNode / Function(h) -
onOk 点击确定回调 () => Promise<void> -