forked from opentiny/tiny-vue
36 lines
827 B
Vue
36 lines
827 B
Vue
<template>
|
|
<div>
|
|
<tiny-button @click="openDrawer('left')"> left </tiny-button>
|
|
<tiny-button @click="openDrawer('right')"> right </tiny-button>
|
|
<tiny-button @click="openDrawer('top')"> top </tiny-button>
|
|
<tiny-button @click="openDrawer('bottom')"> bottom </tiny-button>
|
|
|
|
<tiny-drawer title="标题" :placement="placement" :visible="visible" @update:visible="visible = $event">
|
|
<div style="padding: 32px">内容区域</div>
|
|
</tiny-drawer>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { Drawer, Button } from '@opentiny/vue'
|
|
|
|
export default {
|
|
components: {
|
|
TinyDrawer: Drawer,
|
|
TinyButton: Button
|
|
},
|
|
data() {
|
|
return {
|
|
visible: false,
|
|
placement: 'right'
|
|
}
|
|
},
|
|
methods: {
|
|
openDrawer(side) {
|
|
this.placement = side
|
|
this.visible = true
|
|
}
|
|
}
|
|
}
|
|
</script>
|