<template>
    <div class="ht-base-drawer-demo">
        <div class="demo-drawer-center">
            <div class="demo-drawer-left">
                <ht-base-button type="primary" @click="showDrawer('left')">从左滑出</ht-base-button>
                <ht-base-drawer title="基本抽屉" placement="left" :closable="false" @on-close="onClose('left')" v-model="leftVisible">
                    <p>这里显示一些相关内容…</p>
                    <p>这里显示一些相关内容…</p>
                    <p>这里显示一些相关内容…</p>
                </ht-base-drawer>
            </div>
            <div class="demo-drawer-right">
                <ht-base-button type="primary" @click="showDrawer('right')"> 从右滑出</ht-base-button>
                <ht-base-drawer title="基本抽屉" placement="right" :closable="false" @on-close="onClose('right')" v-model="rightVisible">
                    <p>这里显示一些相关内容…</p>
                    <p>这里显示一些相关内容…</p>
                    <p>这里显示一些相关内容…</p>
                </ht-base-drawer>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'HtBaseDrawerDemo',
        data() {
            return {
                leftVisible: false,
                rightVisible: false,
            }
        },
        methods: {
            showDrawer(params) {
                if (params == "left") {
                    this.leftVisible = true
                } else if (params == "right") {
                    this.rightVisible = true
                }
            },
            onClose(params) {
                if (params == "left") {
                    this.leftVisible = false
                } else if (params == "right") {
                    this.rightVisible = false
                }
            },
        },
    }
</script>
<style lang="less">
    .ht-base-drawer-demo {
        .demo-drawer-center {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
        }
    }
</style>
