Expand description
写文章与编辑文章(/admin/write、/admin/write/:id)。
无干扰编辑:页头(返回、面包屑、保存状态、预览、属性、保存按钮)替代后台顶栏;
衬线标题、元信息行与 Tiptap 正文居中,文章属性在右侧抽屉。保存后留在本页,
新文章首次保存后换到编辑路由。未保存的修改在同一标签页留有本地副本,离开前确认。
新文章正文为空时给出起步模板。编辑器通过 crate::bridges::tiptap 在 WASM 前端
初始化。样式见 styles/pages/admin-write.css。
Modules§
- cover 🔒
- 封面上传、素材选择与预览,上传临时状态仅在本组件中持有。
- editor 🔒
- 文章编辑器的初始化与清理。文章在本模块运行前已取回,表单以服务端内容起步, 本地恢复副本才能与之比较。
- metadata 🔒
- 文章属性抽屉:永久链接、标签、摘要、封面与字数;与正文编辑器共享表单。
- save 🔒
- Saving uses a captured form snapshot and one result path for create/update.
- state 🔒
- Form data, the saved baseline and the editor lifecycle. Readiness has one state, so a failed initialization cannot leave the page trapped under the loading skeleton.
Structs§
- Write
Edit 🔒Props - Props for the
WriteEditcomponent. - Write
Edit Route - 编辑文章(
/admin/write/:id)。 - Write
Editor 🔒Props - Props for the
WriteEditorcomponent. - Write
Route - 新建文章(
/admin/write)。
Constants§
- STARTERS 🔒
- 起步模板:(名称,说明,正文)。「空白」没有正文,只收起入口。
Functions§
- Write
Edit 🔒 - 编辑文章:先取文章,再以服务端内容挂载编辑器。
- Write
Editor 🔒 - 编辑器页面本体,新建与编辑共用。
- __
Write 🔒Edit Route_ View - __
Write 🔒Route_ View - focus_
editor 🔒 - 把焦点放进正文编辑区。