Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add listing category and author page #63

Merged
merged 7 commits into from
May 18, 2020
Merged

Conversation

kwhsiung
Copy link
Contributor

  • 新增 /category/:name/author/:id routes 對應之 page components 及對應測試。
  • Notes:
    • 上述兩個 routes 與 /section/:name 之 html template 與 data-binding 邏輯相同,唯有 data fetching 與 data processing 邏輯稍有差異。
    • 由於上述原因,目前以下 page component 及對應測試有大量重複程式碼,由於目前 listing 頁面尚缺 /topic/:id, /section/topic/search/:query 頁面尚未實作,待所有情境皆實作完成再來考慮針對重複的程式碼重構。
      • /page/section/_name.vue
      • /page/category/_name.vue
      • /page/author/_id.vue

@kwhsiung kwhsiung self-assigned this May 17, 2020
@hcchien
Copy link
Member

hcchien commented May 17, 2020

template 看起來幾乎一模一樣,可以共用嗎?
fetchData 倒是差別比較大

@kwhsiung
Copy link
Contributor Author

template 看起來幾乎一模一樣,可以共用嗎?
fetchData 倒是差別比較大

目前的 listing 頁面的 template 主要只有以下兩個 features:

  1. listing the data
  2. auto-loadmore

目前 1. 已經切出一個 UIArticleList component,我認為已達到共用效果,唯有 2. 的部分目前的確有較大塊的重複程式碼,已透過 266a0b53f3e8ec 稍微重構了。

以 section 頁的 template 來說,目前已簡化為下:

<template>
  <section class="section">
    <UIArticleList
      class="section__list"
      :listTitle="currentSectionTitle"
      :listTitleColor="currentSectionThemeColor"
      :listData="listData"
    />
    <UIInfiniteLoading
      v-if="shouldMountInfiniteLoading"
      @infinite="infiniteHandler"
    />
  </section>
</template>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants