perf: 优化无内容时的 placeholder

This commit is contained in:
xiaozzzi 2024-01-09 22:59:41 +08:00
parent 90dbc2fa34
commit c52635661d
5 changed files with 19 additions and 2 deletions

View File

@ -62,6 +62,9 @@
</bl-row>
<div class="web-item-container">
<div v-if="isEmpty(data)" class="placeholder">
无收藏网址点击上方 <span class="iconbl bl-add-line" style="padding-right: 10px"></span>添加
</div>
<div v-for="(collect, index) in data" @click="closeForm">
<bl-row just="flex-end" class="web-collect-group" :style="index == 0 ? 'marginTop:0' : ''">
{{ collect.title }}
@ -97,6 +100,7 @@ import { isNotBlank, isNotNull } from '@renderer/assets/utils/obj'
import { openExtenal, openNewIconWindow } from '@renderer/assets/utils/electron'
import { useLifecycle } from '@renderer/scripts/lifecycle'
import { ViewStyle, useConfigStore } from '@renderer/stores/config'
import { isEmpty } from 'lodash'
const configStore = useConfigStore()
const viewStyle = ref<ViewStyle>(configStore.viewStyle)
@ -109,6 +113,10 @@ useLifecycle(
const data = ref<any>([])
const getWebAll = () => {
webAllApi().then((resp) => {
if (isEmpty(resp.data.daily) && isEmpty(resp.data.work) && isEmpty(resp.data.other)) {
data.value = []
return
}
let webs = [
{ title: 'Daily', webs: resp.data.daily },
{ title: 'Work', webs: resp.data.work },
@ -236,6 +244,12 @@ const showWebCollectCard = (card: boolean) => {
@include box(100%, calc(100% - 31px));
overflow-y: overlay;
.placeholder {
@include font(15px, 300);
padding: 20px 0 0 20px;
color: var(--bl-text-color-light);
}
&::-webkit-scrollbar {
width: 4px;
height: 3px;

View File

@ -6,7 +6,7 @@
<span v-else class="iconbl bl-article-line container-operator" @click="showStarCard(true)" />
</bl-row>
<div class="article-stars-root">
<div v-if="isEmpty(articles)" class="placeholder">无收藏文章</div>
<div v-if="isEmpty(articles)" class="placeholder">无收藏文章</div>
<div
v-else
v-for="article in articles"
@ -92,6 +92,7 @@ defineExpose({ reload })
}
.placeholder {
@include font(15px, 300);
padding: 20px 0 0 20px;
color: var(--bl-text-color-light);
}

View File

@ -94,6 +94,7 @@ const toToc = (articleId: number) => {
}
.placeholder {
@include font(15px, 300);
padding: 20px 0 0 20px;
color: var(--bl-text-color-light);
}

View File

@ -17,7 +17,7 @@
<el-button size="default" style="width: 90px; margin-left: 10px" @click="autuUpdBlossomOSDomain">点击自动配置</el-button>
<div class="conf-tip">
文件访问地址需以<code style="color: var(--el-color-danger)">/pic</code>结尾你可以点击右上角的<span
class="iconbl bl-blog"
class="iconbl bl-caution-line"
style="padding: 0 3px"></span
>图标进行快捷配置
</div>

View File

@ -203,6 +203,7 @@ const getTasks = () => {
}
.placeholder {
@include font(15px, 300);
padding: 20px 0 0 20px;
color: var(--bl-text-color-light);
}