docs: update LLM guides for completed architecture phase
Refresh the development guidance to point to layered src GUIDE files and document Phase 4 completion, including AppShell extraction and page driver/component adoption for non-maintenance pages.docs: update LLM guides for completed architecture phase Refresh the development guidance to point to layered src GUIDE files and document Phase 4 completion, including AppShell extraction and page driver/component adoption for non-maintenance pages.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# Views Guide
|
||||
|
||||
`views` 是 route entry。View 應維持薄層,負責掛載 page driver 與 page component,不承載大段 UI、dialog、表單欄位或 store mutation 細節。
|
||||
|
||||
## 規則
|
||||
|
||||
- 使用 `<script setup lang="ts">`。
|
||||
- 直接 route component 放在 `src/views` 或 `src/views/<feature>`。
|
||||
- 一般 view 目標 < 80 行。
|
||||
- route params/query 的解析可在 view 做簡單轉換;超過簡單轉換時放進 page driver。
|
||||
- 不直接 import 或包住 `MainLayout.vue`。
|
||||
- 不直接定義大型 `<v-dialog>`、`<v-overlay>`、大型表格或大型表單。
|
||||
|
||||
## 建議形狀
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import PageReports from '@/components/pages/PageReports.vue'
|
||||
import { useReportsPage } from '@/composables/page-drivers/useReportsPage'
|
||||
|
||||
const page = useReportsPage()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageReports :page="page.pageModel.value" />
|
||||
</template>
|
||||
```
|
||||
|
||||
## 子目錄
|
||||
|
||||
- `views/maint` 是 maintenance demo route entry。詳見 `src/views/maint/GUIDE.md`。
|
||||
- `views/errors` 是錯誤頁入口,通常使用 `meta.layout = 'none'`。
|
||||
@@ -0,0 +1,23 @@
|
||||
# Maintenance Views Guide
|
||||
|
||||
`views/maint` 是維護頁 demo。所有檔案都應是薄 route entry,實際 UI 與流程分別放在 `components/pages`、`components/sections`、`components/items` 與 `composables/page-drivers`。
|
||||
|
||||
## 目前範本
|
||||
|
||||
- `SingleRecord.vue`:單主檔 CRUD + dialog。
|
||||
- `EditableGrid.vue`:可編輯表格。
|
||||
- `MasterDetailA.vue`:主檔 + 側邊明細 panel。
|
||||
- `MasterDetailB.vue`:主檔 + collapse / full-height 明細。
|
||||
- `MasterDetailC.vue`:主檔 + 簡化明細清單。
|
||||
|
||||
## 複製規則
|
||||
|
||||
複製維護頁時同步調整:
|
||||
|
||||
- `router/routes.ts` 的 `path`、`name`、`component`、`meta.layout`
|
||||
- page driver 名稱與 import
|
||||
- page component 名稱與 import
|
||||
- 頁面標題、查詢欄位、表格欄位、form 型別、驗證規則
|
||||
- store、service、model、語系、menu/favorites/breadcrumb 相關資料
|
||||
|
||||
正式 domain 不應長期塞在 `maint`,複製後優先移到自己的 feature 目錄。
|
||||
Reference in New Issue
Block a user