Skip to content

Commit

Permalink
update week22 檢討
Browse files Browse the repository at this point in the history
  • Loading branch information
aszx87410 committed Dec 2, 2020
1 parent 9aea3ed commit 4f72d53
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/week22/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@

(在 blog-finished 這個 branch 裡面)

## 有關分頁

太多人分頁都在前端做了,這是不好的做法,想一個問題就行了:

> 如果有一千篇文章怎麼辦?
你不可能只要看第一頁,結果抓 1000 篇文章下來吧?

正確做法是每換一次頁面就打 api 去抓相對應的文章,要看幾篇就抓幾篇,api 有支援 `_limit``_page` 之類的,然後 response header 有總共的文章數量,不要再把分頁做在前端了。



0 comments on commit 4f72d53

Please sign in to comment.