File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11<template >
2- <Skeleton :loading =" isLoading && questionCount === 0 " :count =" 5" ></Skeleton >
3- <div v-if =" !isLoading && questionCount > 0" >
2+ <Skeleton :loading =" isInitLoading " :count =" 5" ></Skeleton >
3+ <div v-if =" !isInitLoading && questionCount > 0" >
44 <p class =" uk-text-left uk-text-muted uk-text-small" >@{{ props.pageProfileName }} 以前回答过的问题 ({{
55 questionCount
66 }})</p >
@@ -52,6 +52,7 @@ const props = defineProps({
5252const router = useRouter ()
5353
5454const PAGE_SIZE = 20
55+ const isInitLoading = ref <boolean >(true )
5556const isLoading = ref <boolean >(false )
5657const hasMore = ref <boolean >(true )
5758const questionCursor = ref <string >(' ' )
@@ -72,6 +73,7 @@ const fetchQuestions = () => {
7273 })
7374 .finally (() => {
7475 isLoading .value = false
76+ isInitLoading .value = false
7577 })
7678}
7779
Original file line number Diff line number Diff line change 11<template >
2- <Skeleton :count =" 3" :loading =" isLoading" >
2+ <Skeleton :count =" 3" :loading =" isInitLoading" ></Skeleton >
3+ <div v-if =" !isInitLoading" >
34 <a v-for =" (question) in questions" v-bind:key =" question.id" @click =" handleView(question)" >
45 <div >
56 <hr >
1011 <p class =" uk-text-small" >{{ question.content }}</p >
1112 </div >
1213 </a >
13- </Skeleton >
14+ </div >
1415
1516 <div >
1617 <button v-if =" hasMore" type =" button" class =" uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom"
@@ -39,6 +40,7 @@ const router = useRouter()
3940const authStore = useAuthStore ()
4041
4142const PAGE_SIZE = 20
43+ const isInitLoading = ref <boolean >(true )
4244const isLoading = ref <boolean >(false )
4345const hasMore = ref <boolean >(true )
4446const questionCursor = ref <string >(' ' )
@@ -56,6 +58,7 @@ const fetchQuestions = () => {
5658 })
5759 .finally (() => {
5860 isLoading .value = false
61+ isInitLoading .value = false
5962 })
6063}
6164
You can’t perform that action at this time.
0 commit comments