48 lines
859 B
Vue
48 lines
859 B
Vue
<docs>
|
||
---
|
||
order: 0
|
||
title:
|
||
zh-CN: 基本用法
|
||
en-US: Basic usage
|
||
---
|
||
|
||
## zh-CN
|
||
|
||
基础抽屉,点击触发按钮抽屉从右滑出,点击遮罩区关闭。
|
||
|
||
## en-US
|
||
|
||
Basic drawer.
|
||
|
||
</docs>
|
||
|
||
<template>
|
||
<a-button type="primary" @click="showDrawer">Open</a-button>
|
||
<a-drawer
|
||
v-model:open="open"
|
||
class="custom-class"
|
||
root-class-name="root-class-name"
|
||
:root-style="{ color: 'blue' }"
|
||
style="color: red"
|
||
title="Basic Drawer"
|
||
placement="right"
|
||
@after-open-change="afterOpenChange"
|
||
>
|
||
<p>Some contents...</p>
|
||
<p>Some contents...</p>
|
||
<p>Some contents...</p>
|
||
</a-drawer>
|
||
</template>
|
||
<script lang="ts" setup>
|
||
import { ref } from 'vue';
|
||
const open = ref<boolean>(false);
|
||
|
||
const afterOpenChange = (bool: boolean) => {
|
||
console.log('open', bool);
|
||
};
|
||
|
||
const showDrawer = () => {
|
||
open.value = true;
|
||
};
|
||
</script>
|