1
1
<script setup lang="ts">
2
- import { NFlex , NImage , NSkeleton , NTime , NTimelineItem } from ' naive-ui' ;
2
+ import { NEmpty , NFlex , NImage , NSkeleton , NTime , NTimelineItem } from ' naive-ui' ;
3
3
4
4
import {
5
5
computed ,
@@ -21,6 +21,7 @@ import {
21
21
22
22
import { useImageStore } from ' ~/stores/data/image.store' ;
23
23
import { Colors } from ' ~/styles/colors.style' ;
24
+ import { useI18n } from ' ~/utils' ;
24
25
25
26
const props = defineProps ({
26
27
item: {
@@ -77,6 +78,8 @@ const emit = defineEmits<{
77
78
(e : ' onScrollOutOfView' , event : { item: ListScrollItem ; ref? : HTMLDivElement }): void ;
78
79
}>();
79
80
81
+ const i18n = useI18n (' list' , ' item' );
82
+
80
83
const { item, noHeader, nextHasHeader, poster, episode, hideDate, scrollIntoView } =
81
84
toRefs (props );
82
85
@@ -211,7 +214,9 @@ const ListScrollItemTypeLocal = ListScrollItemType;
211
214
</NFlex >
212
215
213
216
<slot v-if =" item.type === ListScrollItemTypeLocal.placeholder" >
214
- // TODO default placeholder
217
+ <NFlex class =" placeholder" align =" center" justify =" center" :wrap =" false" >
218
+ <NEmpty size =" large" :description =" i18n('placeholder_empty')" />
219
+ </NFlex >
215
220
</slot >
216
221
<NFlex v-else class =" tile" :wrap =" false" >
217
222
<NImage
@@ -261,6 +266,8 @@ const ListScrollItemTypeLocal = ListScrollItemType;
261
266
}
262
267
263
268
.content {
269
+ height : 100% ;
270
+
264
271
.tile {
265
272
@include mixin .hover-background (
266
273
$from : transparent ,
@@ -271,6 +278,10 @@ const ListScrollItemTypeLocal = ListScrollItemType;
271
278
flex : 1 1 auto ;
272
279
padding : 0.5rem ;
273
280
}
281
+
282
+ .placeholder {
283
+ flex : 1 1 auto ;
284
+ }
274
285
}
275
286
276
287
.header {
@@ -387,9 +398,14 @@ const ListScrollItemTypeLocal = ListScrollItemType;
387
398
}
388
399
389
400
.n-timeline-item-content {
401
+ height : 100% ;
390
402
margin-left : calc (var (--n-icon-size ) + 0.125rem );
391
403
border-top : 1px solid transparent ;
392
404
405
+ & __content {
406
+ height : 100% ;
407
+ }
408
+
393
409
& __meta {
394
410
margin : 0 ;
395
411
}
0 commit comments