mahjong_group/components/com/page/no-data.vue
2025-09-08 12:47:02 +08:00

58 lines
1.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="empty-state">
<image class="empty-image" :src="imageSrc" mode="aspectFit"></image>
<text class="empty-text">{{ message }}</text>
</view>
</template>
<script setup>
defineProps({
// 空状态显示的图片默认使用kong.png
imageSrc: {
type: String,
default: '/static/no_content.png'
},
// 空状态显示的文本
message: {
type: String,
default: '暂无数据'
}
});
</script>
<style lang="scss">
.empty-state {
width: 100%;
height: 100%;
// border: 1px solid red;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
animation: emptyFadeIn 0.5s ease-out;
// background-color: #F7F7F7;
}
.empty-image {
width: 200rpx;
height: 200rpx;
margin-bottom: 20rpx;
}
.empty-text {
font-size: 28rpx;
color: #999999;
}
@keyframes emptyFadeIn {
from {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>