如题,我感觉 nuxt.js 加入 app route 可以很大程度的改善 vue sfc 的问题
旧的 page route 结构,经常 page 和 component 两个目录来回跳
- page
- about.tsx
- component # 纯组件
- componentA.tsx
- componentB.tsx
- container # 和业务耦合的组件
- componentC.tsx
app route 文件结构类似这样,只在 about 页面使用的组件完全可以放在 about 下,如果出现多页面复用组件再升级到 component 或者 container 目录
- page
- about
- page.tsx
- componentA.tsx
- componentB.tsx
- componentC.tsx
