WebApp【公共组件库】@前端(For Git Submodule)
‘chensiAb’
6 days ago a44eddf956e7042b64428044f057c76ddf2ac791
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
/**
 * CDrawer - 抽屉
 * @author Tevin
 */
 
<template>
    <view
        class="c-drawer"
        :class="[show?'c-drawer-show':'', 'c-drawer-' + direction]"
    >
        <view
            class="c-drawer-mask"
            @tap="evt => handleClose()"
        ></view>
        <view class="c-drawer-container">
            <slot />
        </view>
    </view>
</template>
 
<script>
import Taro from '@tarojs/taro';
import {} from 'taro-ui-vue';
import './cDrawer.scss';
 
export default {
    name: 'CDrawer',
    components: {},
    props: {
        // 显示隐藏
        show: { type: Boolean, default: false },
        // 从哪个方向滑出,支持 top、left、right
        direction: { type: String, default: 'right' },
        // 关闭回调
        onClose: Function,
    },
    data() {
        return {};
    },
    methods: {
        handleClose() {
            this.onClose();
        },
    },
    mounted() {},
};
</script>