如题,我感觉 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
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.