fix Teleport

This commit is contained in:
jxxghp
2025-07-07 17:24:58 +08:00
parent 3cfe27b7b3
commit cd9eaf4fd7
12 changed files with 47 additions and 27 deletions

View File

@@ -34,6 +34,8 @@ function getApiPath(paths: string[] | string) {
<VPageContentTitle :title="title" />
<PersonCardListView v-if="type === 'person'" :apipath="getApiPath(props.paths || '')" :params="route.query" />
<MediaCardListView v-else :apipath="getApiPath(props.paths || '')" :params="route.query" />
<VScrollToTopBtn />
<Teleport to="body" v-if="route.path === '/browse'">
<VScrollToTopBtn />
</Teleport>
</div>
</template>

View File

@@ -19,6 +19,9 @@ const display = useDisplay()
// PWA模式检测
const { appMode } = usePWA()
// 路由
const route = useRoute()
// 从用户 Store 中获取superuser信息
const superUser = useUserStore().superUser
@@ -353,7 +356,7 @@ onDeactivated(() => {
</draggable>
<!-- 底部操作按钮只在非移动设备上显示 -->
<Teleport to="body">
<Teleport to="body" v-if="route.path === '/dashboard'">
<VFab
v-if="!appMode"
icon="mdi-view-dashboard-edit"

View File

@@ -16,6 +16,9 @@ const display = useDisplay()
// 国际化
const { t } = useI18n()
// 路由
const route = useRoute()
const activeTab = ref('')
// 本地存储键值
@@ -151,10 +154,6 @@ onBeforeMount(async () => {
}
})
onActivated(async () => {
await loadExtraDiscoverSources()
sortSubscribeOrder()
@@ -246,7 +245,9 @@ onActivated(async () => {
</VCard>
</VDialog>
<!-- 快速滚动到顶部按钮 -->
<VScrollToTopBtn />
<Teleport to="body" v-if="route.path === '/discover'">
<VScrollToTopBtn />
</Teleport>
</div>
</template>
<style lang="scss" scoped>

View File

@@ -11,6 +11,9 @@ const display = useDisplay()
// 国际化
const { t } = useI18n()
// 路由
const route = useRoute()
// 当前选择的分类
const currentCategory = ref(t('recommend.all'))
@@ -300,7 +303,9 @@ onActivated(async () => {
</VDialog>
<!-- 快速滚动到顶部按钮 -->
<VScrollToTopBtn />
<Teleport to="body" v-if="route.path === '/recommend'">
<VScrollToTopBtn />
</Teleport>
</div>
</template>

View File

@@ -92,7 +92,7 @@ const progressSSE = useProgressSSE(
`${import.meta.env.VITE_API_BASE_URL}system/progress/search`,
handleProgressMessage,
'resource-search-progress',
progressActive
progressActive,
)
// 使用SSE监听加载进度
@@ -288,7 +288,9 @@ onUnmounted(() => {
<!-- 初始加载状态 -->
<LoadingBanner v-else-if="!isRefreshed && !(progressEnabled || progressValue > 0)" />
<!-- 滚动到顶部按钮 -->
<VScrollToTopBtn />
<Teleport to="body" v-if="route.path === '/resource'">
<VScrollToTopBtn />
</Teleport>
</div>
</template>
@@ -300,7 +302,6 @@ onUnmounted(() => {
justify-content: center;
inset-block-start: env(safe-area-inset-top);
inset-inline: 0;
padding-block-start: 4rem;
}
.search-progress-card {