ant-design-vue/examples/App.vue

65 lines
1.5 KiB
Vue
Raw Normal View History

2020-03-23 03:00:24 +00:00
<template>
2020-06-02 14:09:34 +00:00
<div>
<a-button type="primary" @click="showDrawer">Open</a-button>
<a-drawer
title="Multi-level drawer"
width="520"
:closable="false"
:visible="visible"
@close="onClose"
2020-05-28 11:45:50 +00:00
>
2020-06-02 14:09:34 +00:00
<a-button type="primary" @click="showChildrenDrawer">Two-level drawer</a-button>
<a-drawer
title="Two-level Drawer"
width="320"
:closable="false"
:visible="childrenDrawer"
@close="onChildrenDrawerClose"
>
<a-button type="primary" @click="showChildrenDrawer">This is two-level drawer</a-button>
</a-drawer>
<div
:style="{
position: 'absolute',
bottom: 0,
width: '100%',
borderTop: '1px solid #e8e8e8',
padding: '10px 16px',
textAlign: 'right',
left: 0,
background: '#fff',
borderRadius: '0 0 4px 4px',
boxSizing: 'border-box',
}"
>
<a-button style="marginRight: 8px" @click="onClose">Cancel</a-button>
<a-button type="primary" @click="onClose">Submit</a-button>
</div>
</a-drawer>
</div>
2020-03-23 03:00:24 +00:00
</template>
<script>
export default {
2020-05-28 11:45:50 +00:00
data() {
return {
2020-06-02 14:09:34 +00:00
visible: false,
childrenDrawer: false,
2020-05-28 11:45:50 +00:00
};
},
2020-05-27 11:11:46 +00:00
methods: {
2020-06-02 14:09:34 +00:00
showDrawer() {
this.visible = true;
},
onClose() {
this.visible = false;
},
showChildrenDrawer() {
this.childrenDrawer = true;
},
onChildrenDrawerClose() {
this.childrenDrawer = false;
2020-05-27 11:11:46 +00:00
},
},
2020-03-23 03:00:24 +00:00
};
</script>