内容详情
文档版本:1.3.0
组件名:BhtContentDetail
描述
内容详情组件,用于展示单篇内容的标题、时间和正文。
效果
![]()
示例
<bht-content-detail></bht-content-detail>
代码
<bht-content-detail :ref="item.id" :item="item"></bht-content-detail>
或
<BhtContentDetail :ref="item.id" :item="item"></BhtContentDetail>
参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| item | Object | 否 | - | 组件配置信息。 |
组件配置项
| key | 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| width | 内容宽度 | string | 100% | 请输入内容宽度 |
| titleStyle | 标题样式 | string | line-height: 45px; text-align: center; | 请输入标题样式 |
| dateStyle | 时间样式 | string | text-align: right; margin-right: 60px; | 请输入时间样式 |
| contentStyle | 内容样式 | string | font-size: 14px; | 请输入内容样式 |
| title | 内容标题 | query | - | 请输入内容标题 |
| orderByColumn | 排序字段 | query | createDatetime | 请输入排序字段 |
| isAsc | 排序方式 | query | desc | 请输入排序方式(可选值:desc、asc) |
通用布局配置
| key | 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| componentWidth | 组件宽度 | string | 100% | 支持 100%、320px、50vw |
| componentHeight | 组件高度 | string | - | 可选,例如 360px、50vh |
| componentPositionMode | 布局模式 | select | flow | flow、absolute、fixed |
| componentPositionX | X 位置 | string | - | 自由/固定模式,例如 120px |
| componentPositionY | Y 位置 | string | - | 自由/固定模式,例如 80px |
| componentZIndex | 层级 | string | - | 例如 10 |
| componentHorizontalAlign | 水平对齐 | select | center | left、center、right、stretch |
| componentVerticalAlign | 垂直对齐 | select | top | top、middle、bottom、stretch |
| componentLocked | 锁定位置 | select | false | true、false |
| componentRelativeTo | 参照组件 ID | select | - | 可选择其他已有组件的 id 和名称 |
| componentRelativePlacement | 相对位置 | select | - | right、left、bottom、top |
| componentRelativeGap | 相对间距 | string | 12px | 例如 12px |
通用样式配置
| key | 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| componentMargin | 外边距 | string | - | 例如 16px 或 12px 24px |
| componentPadding | 内边距 | string | - | 例如 16px 或 12px 24px |
| componentMinWidth | 最小宽度 | string | - | 例如 240px |
| componentMaxWidth | 最大宽度 | string | - | 例如 1200px 或 none |
| componentMinHeight | 最小高度 | string | - | 例如 120px |
| componentMaxHeight | 最大高度 | string | - | 例如 720px 或 none |
| componentBackgroundColor | 背景颜色 | color | - | 例如 #ffffff 或 rgba(255,255,255,.9) |
| componentBackgroundImage | 背景图片 | string | - | 例如 url(https://...) 或 linear-gradient(...) |
| componentBackgroundSize | 背景尺寸 | string | - | 例如 cover、contain、100% 100% |
| componentBackgroundPosition | 背景位置 | string | - | 例如 center、left top |
| componentBackgroundRepeat | 背景重复 | select | - | no-repeat、repeat、repeat-x、repeat-y |
| componentBorderColor | 边框颜色 | color | - | 请选择边框颜色 |
| componentBorderWidth | 边框宽度 | string | - | 例如 1px 或 1px 0 0 |
| componentBorderStyle | 边框样式 | select | - | solid、dashed、dotted、none |
| componentBorderRadius | 圆角 | string | - | 例如 8px 或 12px 12px 0 0 |
| componentBoxShadow | 阴影 | string | - | 例如 0 12px 32px rgba(15,23,42,.12) |
| componentOpacity | 透明度 | string | - | 0 到 1,例如 .95 |
| componentOverflow | 溢出处理 | select | - | visible、hidden、auto、clip |
| componentTextAlign | 文本对齐 | select | - | left、center、right、justify |
| componentColor | 文字颜色 | color | - | 请选择文字颜色 |
| componentBoxSizing | 盒模型 | select | border-box | border-box、content-box |
| componentFilter | 滤镜 | string | - | 例如 blur(2px)、grayscale(1) |
| componentBackdropFilter | 背景滤镜 | string | - | 例如 blur(12px) |
| componentCustomStyle | 自定义 CSS | textarea | - | 例如 transform: translateY(8px); |
引入
import { BhtContentDetail } from '@behappyto/cms-ui-vue3'