yangan
昨天 a28d0135ee42809b2c5863609da37155d3ecba5b
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
<template>
    <view class="xm-square" :style="{ paddingBottom: height }">
        <view class="xm-square-box">
            <slot></slot>
        </view>
    </view>
</template>
 
<script>
    export default {
        props: {
            height: {
                type: String,
                default: '100%'
            },
        }
    }
</script>
 
<style scoped lang="scss">
    .xm-square {
        width: 100%;
        height: 0;
        position: relative;
 
        &-box {
            position: absolute;
            width: 100%;
            height: 100%;
        }
    }
</style>