-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathbasic.vue
53 lines (44 loc) · 931 Bytes
/
basic.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<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"
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>