feat: render app shell with ssr to improve loading experience (#448)
This commit is contained in:
parent
b545efeacc
commit
9395b7031e
35 changed files with 169 additions and 127 deletions
|
@ -56,23 +56,25 @@ export function usePaginator<T>(paginator: Paginator<any, T[]>, stream?: WsEvent
|
|||
bound.update()
|
||||
}
|
||||
|
||||
useIntervalFn(() => {
|
||||
bound.update()
|
||||
}, 1000)
|
||||
if (process.client) {
|
||||
useIntervalFn(() => {
|
||||
bound.update()
|
||||
}, 1000)
|
||||
|
||||
watch(
|
||||
() => [isInScreen, state],
|
||||
() => {
|
||||
if (
|
||||
isInScreen
|
||||
watch(
|
||||
() => [isInScreen, state],
|
||||
() => {
|
||||
if (
|
||||
isInScreen
|
||||
&& state.value === 'idle'
|
||||
// No new content is loaded when the keepAlive page enters the background
|
||||
&& deactivated.value === false
|
||||
)
|
||||
loadNext()
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
)
|
||||
loadNext()
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
items,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue