ant-design-vue/components/drawer/demo/basic.vue
tangjinzhou a5a3411c28
refactor: drawer (#4725)
* 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>
2021-10-03 13:30:50 +08:00

56 lines
979 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>