mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
a5a3411c28
* refactor(drawer): use compositionAPI * refactor(drawer): update * refactor: update * chore: update * docs: update * fix: remove transitionStr * chore: use useConfigInject * refactor: drawer #4708 Co-authored-by: ajuner <106791576@qq.com>
56 lines
979 B
Vue
56 lines
979 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:visible="visible"
|
||
class="custom-class"
|
||
style="color: red"
|
||
title="Basic Drawer"
|
||
placement="right"
|
||
@after-visible-change="afterVisibleChange"
|
||
>
|
||
<p>Some contents...</p>
|
||
<p>Some contents...</p>
|
||
<p>Some contents...</p>
|
||
</a-drawer>
|
||
</template>
|
||
<script lang="ts">
|
||
import { defineComponent, ref } from 'vue';
|
||
export default defineComponent({
|
||
setup() {
|
||
const visible = ref<boolean>(false);
|
||
|
||
const afterVisibleChange = (bool: boolean) => {
|
||
console.log('visible', bool);
|
||
};
|
||
|
||
const showDrawer = () => {
|
||
visible.value = true;
|
||
};
|
||
|
||
return {
|
||
visible,
|
||
afterVisibleChange,
|
||
showDrawer,
|
||
};
|
||
},
|
||
});
|
||
</script>
|