cshenfu
2024-05-21 09d8c671d5e6e6045677bfb5218a5fb78c26aa0f
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
    <view class="empty-block">
        <block v-if="!loading">
            <image src="../../static/common/nodata.svg" mode="widthFix" style="width: 500rpx;"></image>
            <view class="tip-text">
                {{tipText}}
            </view>
        </block>
        <block v-else="loading">
            <image src="../../static/common/loading.svg" mode="widthFix" style="width: 500rpx;"></image>
            <view class="tip-text">
                努力加载中...
            </view>
        </block>
 
    </view>
</template>
 
<script>
    export default {
        props: {
            bgColor: {
                type: String,
                default: "rgba(0,0,0,0)"
            },
            textColor: {
                type: String,
                default: "#909399"
            },
            tipText: {
                type: String,
                default: "暂无内容"
            },
            loading: {
                type: Boolean,
                default: false
            }
        },
        name: "empty",
        data() {
            return {
                emptyIcon: require('@/static/common/nodata.svg')
            };
        }
    }
</script>
 
<style lang="scss" scoped>
    .empty-block {
        position: relative;
        width: 100%;
        padding: 100rpx 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
 
        .tip-text {
            margin-top: 20rpx;
            font-size: 26rpx;
            letter-spacing: 2rpx;
        }
    }
</style>