mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-02 17:53:47 +08:00
Add layout registration, visual editing, and source generation. Preserve embedded pages and wait for asynchronous layout renderers. Add workspace lint and formatting commands.
17 lines
4.4 KiB
Markdown
17 lines
4.4 KiB
Markdown
# Bootstrap, layout, and application state
|
|
|
|
Use this topic for providers, navigation layouts, page caching, the settings drawer, Pinia, or persistence issues.
|
|
|
|
| Question | Read first | Follow through |
|
|
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| Initial rendering, Wujie mounting, and global services | [Application bootstrap](../../apps/admin/src/main.ts), [App provider composition](../../apps/admin/src/App.tsx) | [Application providers](../../apps/admin/src/app-components/provider), [shared UI service interfaces](../../packages/ui/src/services.ts), [development diagnostics](../../apps/admin/src/doctor/index.ts) |
|
|
| Sidebar, top navigation, tabs, and search | [Application layout adapter](../../apps/admin/src/layout/index.tsx), [application navigation hook](../../apps/admin/src/hooks/template/useAppNavigation.ts) | [Shared AdminShell](../../packages/admin-shell/src/AdminShell.tsx), [host layout components](../../apps/admin/src/layout/components), [slot contract](../../apps/admin/src/layout/README.md) |
|
|
| Content area, loading, navigation, and KeepAlive | [Host content slot](../../apps/admin/src/layout/default/ContentWrapper/index.tsx), [host transition adapter](../../apps/admin/src/components/RTransitionComponent) | [Shared transitions and cached rendering](../../packages/admin-shell/src/RouteTransition.vue), [cache allowlist](../../apps/admin/src/store/modules/keep-alive/index.ts), [page request cancellation](api.md) |
|
|
| Layout preferences, JSON import/export, and transient state | [Settings store](../../apps/admin/src/store/modules/setting/index.ts), [preference-file validation](../../apps/admin/src/store/modules/setting/preference-file.ts), [runtime store](../../apps/admin/src/store/modules/runtime/index.ts) | [Host settings drawer](../../apps/admin/src/layout/components/SiderBar/components/SettingDrawer/index.tsx), [shared layout settings](../../packages/admin-shell/src/LayoutSettings.tsx), [reader guide](../../apps/docs/guide/layout.md) |
|
|
|
|
For a new layout or a generator change, start with the [layout definitions](../../apps/admin/src/layout/definitions), [registry](../../apps/admin/src/layout/useLayout.ts), [designer](../../apps/admin/src/layout/designer.ts), and [development writer](../../vite-helper/layout-writer.ts).
|
|
|
|
The layout package owns the shell and rendering; the application supplies navigation, settings, content, and runtime state. Access application stores through [hooks](../../apps/admin/src/store/hooks). See the [store conventions](../../apps/admin/src/store/README.md) for persistence scope and historical formats. Preference files contain layout settings only; route sources and route JSON belong to [routing](routing.md).
|
|
|
|
Targeted verification: `pnpm harness verify layout`, including [layout regressions](../../__test__/layout), [providers](../../__test__/app/global-provider.spec.ts), and related hooks. Select affected layout modes using the [browser dimensions](../README.md#browser-verification). Check narrow widths for sizing changes, and reload restoration/readback when cache or preference behavior changes.
|