Release 2.7.0: executable handbooks and native user-site workflows
This commit is contained in:
1 parent
aa0c4d0f55
commit
d9aef957f7
562 files changed
+21064
-20387
No files matched your search
@@ -1,20 +1,32 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Session-aware nav component
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
---
|
||||
|
||||
This module owns only the selected navigation responsibility. Its labels and destinations retain the original site order. The session-dependent rows are a typed navigation resource because their visibility must follow each request rather than a startup snapshot.
|
||||
|
||||
## nav
|
||||
|
||||
Brand first, then demo routes. Guest sees **Login**; signed-in sees **Admin** + **Logout**.
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One typed navigation resource with stable fragment identity |
|
||||
|
||||
`nav` =
|
||||
Construction is pure and does not log in, log out or register a route. Empty when values keep links visible; guest and auth use the actual session supplied by the server. The resource renderer retains native navigation classes for the existing theme. Hiding Admin never protects its URL: the serving entry separately binds a real /admin role gate.
|
||||
|
||||
| front | back | style | media | when |
|
||||
|-------|------|-------|-------|------|
|
||||
| Marqdo | / | | | |
|
||||
| About | /about | | | |
|
||||
| New | /new | | | |
|
||||
| Login | /login | | | guest |
|
||||
| Admin | /admin | | | auth |
|
||||
| Logout | /admin/logout | | | auth |
|
||||
The parent places this region and owns its grid relationship. Edit labels here and update declared routes when changing a destination; do not concatenate an HTML navigation string or return an obsolete front/back binding table.
|
||||
|
||||
*`nav`*
|
||||
`items` =
|
||||
|
||||
| @ | label | href | when |
|
||||
|---|---|---|---|
|
||||
| 1 | Marqdo | / | |
|
||||
| 2 | About | /about | |
|
||||
| 3 | New | /new | |
|
||||
| 4 | Login | /login | guest |
|
||||
| 5 | Admin | /admin | auth |
|
||||
| 6 | Logout | /admin/logout | auth |
|
||||
|
||||
We **resource = [Describe current-session navigation](component.navigation(items=`items`, region="nav"))**.
|
||||
Return *[Keep this region as a typed View resource](component.resource(value=`resource`, slot="nav"))*.
|
||||
Reference in new issue
Block a user