Skip to content

Commit

Permalink
Merge pull request #303 from Baihhh/fixPage
Browse files Browse the repository at this point in the history
fix: home page article null
  • Loading branch information
IRONICBo committed Mar 14, 2024
2 parents ff62765 + 5352855 commit d7a6631
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cmd/gopcomm/yap/home_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,11 @@ <h1 v-else class="text-4xl"> Have no data!</h1>
/*======= load more data after reaching bottom =======*/
// const videoGet = ref(false);
// const stemGet = ref(false);
console.log("articles", articles)
const videoList = ref([]);
const stemList = ref([]);
const articleList = ref({
article: articles,
article: articles || [],
video: [],
stem: [],
});
Expand Down Expand Up @@ -651,7 +652,7 @@ <h1 v-else class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
console.log("todos.next", todos.next)
if(todos.items == null){
if(todos.items === null){
todos.items = []
}
articleList.value[tabName].push(...todos.items);
Expand Down
8 changes: 4 additions & 4 deletions cmd/gopcomm/yap/user_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@ <h1 class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
if (format === "video") {
videoList.value = todos.items
videoList.value = todos.items || []
videoGet.value = true
totalVideoPage.value = Math.ceil(todos.total/pageSize.value);
} else {
imageList.value = todos.items
imageList.value = todos.items || []
imageGet.value = true
totalImagePage.value = Math.ceil(todos.total/pageSize.value);
}
Expand All @@ -769,7 +769,7 @@ <h1 class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
userGet.value = true
userList.value = todos.items
userList.value = todos.items || []
totalUserPage.value = Math.ceil(todos.total/pageSize.value);
console.log("userList", userList.value)
console.log("totalUserPage", totalUserPage.value)
Expand Down Expand Up @@ -851,7 +851,7 @@ <h1 class="text-4xl"> Have no data!</h1>
})
.then(todos => {
if (todos.code === 200) {
articleList.value = todos.items;
articleList.value = todos.items || [];
totalArticlePage.value = Math.ceil(todos.total/pageSize.value);
addShareCount();
}
Expand Down

0 comments on commit d7a6631

Please sign in to comment.