docs(pages): clarify page driver component boundaries
Add inline comments to page components documenting how page models, v-model state, and emitted user intents flow through the page driver. This clarifies that page components remain presentation-focused while routing, dialog state, CRUD side effects, and command handling stay in the page driver or related composables.docs(pages): clarify page driver component boundaries Add inline comments to page components documenting how page models, v-model state, and emitted user intents flow through the page driver. This clarifies that page components remain presentation-focused while routing, dialog state, CRUD side effects, and command handling stay in the page driver or related composables.
This commit is contained in:
@@ -39,5 +39,6 @@ const page = useReportsPage()
|
||||
|
||||
## 子目錄
|
||||
|
||||
- `views/demos` 是一般頁面與 section 使用方式的 demo route entry,仍需維持薄 view。
|
||||
- `views/maint` 是 maintenance demo route entry。詳見 `src/views/maint/GUIDE.md`。
|
||||
- `views/errors` 是錯誤頁入口,通常使用 `meta.layout = 'none'`。每個錯誤頁(`Forbidden.vue`、`ServerError.vue`、`NotFound.vue` 等)只傳入 props 給共用的 `ErrorShell.vue`,不再各自重複佈局邏輯。`ErrorShell.vue` 提供標題、圖示、顏色、描述、後端訊息、操作按鈕(返回上頁 / 回首頁 / 前往登入)等 slots。
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import PageSectionQueryPageDemo from '@/components/pages/PageSectionQueryPageDemo.vue'
|
||||
import { useSectionsDemoPage } from '@/composables/page-drivers/useSectionsDemoPage'
|
||||
|
||||
// Demo view 維持薄層,只掛 page driver,並把 page model / actions 傳給 page component。
|
||||
const page = useSectionsDemoPage()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageSectionQueryPageDemo
|
||||
v-model:query-filters="page.queryFilters.value"
|
||||
:page="page.pageModel.value"
|
||||
@back="page.handleQueryBack"
|
||||
@search="page.handleQuerySearch"
|
||||
/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user