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
<!--
* Ag Grid 没有行数据时的渲染组件
-->
<script setup lang="ts">
defineProps<{
params: any;
}>();
</script>
<template>
<div class="my-ag-grid-no-rows-component">
<div class="my-ag-grid-no-rows-component-content">
<div class="my-ag-grid-no-rows-component-img" v-if="!params.dense"></div>
<div :class="{ 'my-ag-grid-no-rows-component-text': !params.dense }">
{{ params.noRowsMessageFunc ? params.noRowsMessageFunc() : '暂无数据' }}
</div>
</div>
</div>
</template>
<style lang="scss">
.my-ag-grid-no-rows-component {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
.my-ag-grid-no-rows-component-content {
width: 100%;
height: calc(100% - 50px);
box-sizing: border-box;
position: relative;
display: flex;
justify-content: center;
align-items: center;
.my-ag-grid-no-rows-component-img {
width: 100%;
height: 100px;
box-sizing: border-box;
background: url('../../assets/no-data.svg');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.my-ag-grid-no-rows-component-text {
position: absolute;
height: 40px;
width: 100px;
text-align: center;
line-height: 40px;
top: 50%;
left: 50%;
transform: translate(-50px, 38px);
box-sizing: border-box;
color: var(--my-ag-grid-primary);
}
}
}
</style>