修复home 的伪数据

jc/orziz
orzi 2 weeks ago
parent afa01da5bf
commit 93f33d760e

4
web/.gitignore vendored

@ -28,3 +28,7 @@ yarn.lock
package-lock.json
components.d.ts
/stats.html
.claude
.agents
skills-lock.json

@ -9,7 +9,7 @@
</n-list-item>
<n-list-item v-if="showTrendsBar" >
<SlideBar v-model="slideBarList" :wheel-blocks="wheelBlocks" :init-blocks="initBlocks" @click="handleBarClick" tag="div" sub-tag="div">
<SlideBar :key="slideBarKey" v-model="slideBarList" :wheel-blocks="wheelBlocks" :init-blocks="initBlocks" @click="handleBarClick" tag="div" sub-tag="div">
<template #default="data">
<div class="slide-bar-item">
<n-badge value="1" :offset="[-4, 48]" dot :show="data.slotData.show">
@ -142,6 +142,7 @@ const onFollowingTweets = () => {
const initBlocks = ref(9);
const wheelBlocks = ref(8);
const slideBarKey = ref(0);
const slideBarList = ref<Item.SlideBarItem[]>([
{ title: '', style: 1, username: '', avatar: allTweets, show: true },
{
@ -158,17 +159,6 @@ const slideBarList = ref<Item.SlideBarItem[]>([
avatar: followingTweets,
show: false,
},
// TODO: 不知道SlideBar抽什么疯如果没有填充下面这些伪数据的话直接设置initBlocks为9而给的数据又不足后面动态添加数据后吖的竟然不能后划了
// f*k不知道哪姿势不对总之先凑合着用吧后期再优化。
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
{ title: '', style: 1, username: '', avatar: '', show: true },
]);
const user = reactive<Item.UserInfo>({
id: 0,
@ -344,6 +334,7 @@ const loadContacts = () => {
}
if (barItems.length > 0) {
slideBarList.value = slideBarList.value.concat(barItems);
slideBarKey.value++;
}
})
.catch((err) => {

Loading…
Cancel
Save