Files
2026-10-30 14:28:27 +08:00

24 lines
756 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 文章编辑与预览
左侧编辑、右侧预览,两侧共用同一个 `Article` 对象,改动实时联动。
## 组合演示
:::preview 编辑与预览联动 || 切换正文类型时两侧同时切换渲染分支
demo-preview=../demos/scenarios/article.vue
:::
## 这个场景覆盖了什么
- **正文类型切换**:纯文本、Markdown、富文本三种形态共用一份数据
- **实时联动**:`ArticleEditor` 抛出的更新直接喂给 `ArticleView`
- **字段保留**:`title` 等业务字段由外层维护,编辑器不会丢字段
- **提交语义**:`submit()` 等待未完成的媒体上传后再返回最终数据
## 相关组件
- [ArticleEditor](/components/article-editor)
- [ArticleView](/components/article-view)