refactor: no reactivity transform (#2600)
This commit is contained in:
parent
b9394c2fa5
commit
ccfa7a8d10
102 changed files with 649 additions and 652 deletions
|
@ -8,14 +8,14 @@ definePageMeta({
|
|||
const route = useRoute()
|
||||
const { t } = useI18n()
|
||||
|
||||
const list = $computed(() => route.params.list as string)
|
||||
const server = $computed(() => (route.params.server ?? currentServer.value) as string)
|
||||
const list = computed(() => route.params.list as string)
|
||||
const server = computed(() => (route.params.server ?? currentServer.value) as string)
|
||||
|
||||
const tabs = $computed<CommonRouteTabOption[]>(() => [
|
||||
const tabs = computed<CommonRouteTabOption[]>(() => [
|
||||
{
|
||||
to: {
|
||||
name: 'list',
|
||||
params: { server, list },
|
||||
params: { server: server.value, list: list.value },
|
||||
},
|
||||
display: t('tab.posts'),
|
||||
icon: 'i-ri:list-unordered',
|
||||
|
@ -23,7 +23,7 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
|
|||
{
|
||||
to: {
|
||||
name: 'list-accounts',
|
||||
params: { server, list },
|
||||
params: { server: server.value, list: list.value },
|
||||
},
|
||||
display: t('tab.accounts'),
|
||||
icon: 'i-ri:user-line',
|
||||
|
@ -31,12 +31,12 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
|
|||
],
|
||||
)
|
||||
|
||||
const { client } = $(useMasto())
|
||||
const { data: listInfo, refresh } = $(await useAsyncData(() => client.v1.lists.$select(list).fetch(), { default: () => shallowRef() }))
|
||||
const { client } = useMasto()
|
||||
const { data: listInfo, refresh } = await useAsyncData(() => client.value.v1.lists.$select(list.value).fetch(), { default: () => shallowRef() })
|
||||
|
||||
if (listInfo) {
|
||||
useHydratedHead({
|
||||
title: () => `${listInfo.title} | ${route.fullPath.endsWith('/accounts') ? t('tab.accounts') : t('tab.posts')} | ${t('nav.lists')}`,
|
||||
title: () => `${listInfo.value.title} | ${route.fullPath.endsWith('/accounts') ? t('tab.accounts') : t('tab.posts')} | ${t('nav.lists')}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ definePageMeta({
|
|||
})
|
||||
|
||||
const params = useRoute().params
|
||||
const listId = $(computedEager(() => params.list as string))
|
||||
const listId = computedEager(() => params.list as string)
|
||||
|
||||
const paginator = useMastoClient().v1.lists.$select(listId).accounts.list()
|
||||
const paginator = useMastoClient().v1.lists.$select(listId.value).accounts.list()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -4,12 +4,12 @@ definePageMeta({
|
|||
})
|
||||
|
||||
const params = useRoute().params
|
||||
const listId = $(computedEager(() => params.list as string))
|
||||
const listId = computedEager(() => params.list as string)
|
||||
|
||||
const client = useMastoClient()
|
||||
|
||||
const paginator = client.v1.timelines.list.$select(listId).list()
|
||||
const stream = useStreaming(client => client.list.subscribe({ list: listId }))
|
||||
const paginator = client.v1.timelines.list.$select(listId.value).list()
|
||||
const stream = useStreaming(client => client.list.subscribe({ list: listId.value }))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue