feat: 增加no-data组件

This commit is contained in:
rd
2025-07-01 16:39:47 +08:00
parent bc5aea9457
commit 817b648420
12 changed files with 139 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,49 @@
<!--
* @Author: RenXiaoDong
* @Date: 2025-07-01 16:09:21
-->
<template>
<div class="no-data">
<slot name="pic">
<img :src="emptyIcon" class="img" alt="" width="106" height="72" />
</slot>
<slot>
<div v-if="text" class="text mt-36px">{{ text }}</div>
</slot>
</div>
</template>
<script setup>
import icon from './img/icon-empty.png';
const props = defineProps({
text: {
type: String,
default: '暂无数据',
},
emptyIcon: {
type: String,
default: icon,
},
});
</script>
<style lang="scss" scoped>
.no-data {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding-top: 10%;
padding-bottom: 10%;
line-height: 1.5em;
.text {
color: var(--Text-3, #737478);
font-family: 'PuHuiTi-Regular';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
}
}
</style>

View File