Files
timi-tdesign-mobile/docs/components/article-view.md
T
2026-09-21 16:05:14 +08:00

30 lines
667 B
Markdown

# ArticleView 文章视图
按 `Article` 的正文类型渲染正文内容。
## 基础用法
:::preview 基础用法 || 把 contentType 换成 TEXT 或 MARKDOWN 会切换渲染分支
demo-preview=../demos/article-view/basic.vue
:::
## 何时使用
需要在详情页只读展示文章正文时使用,与 `ArticleEditor` 共用同一套数据类型。
## 渲染分支
| contentType | 渲染方式 |
| --- | --- |
| `TEXT` | 只读文本域。 |
| `MARKDOWN` | 由 timi-web 的 MarkdownView 渲染。 |
| `TIP_TAP` | 由 [TiptapView](/components/tiptap-view) 渲染。 |
内容为空时统一显示 `emptyText`。
## API
<api-table name="ArticleView" />