Comment 商品评论
参考 NutUI 的 comment 组件,支持对象驱动的评论详情、图片/视频、追评与操作栏。
展示评论信息,支持评论详情、图片/视频、追评与操作栏
演示
9:41
代码示例
引入
推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-comment />。
API
Comment Props
| 名称 | 类型 | 默认值 | 描述 | 必传 |
|---|---|---|---|---|
| avatar | string | '' | - | N |
| name | string | '' | 标识名称 | N |
| date | string | '' | - | N |
| rate | number | 5 | - | N |
| content | string | '' | 内容文字 | N |
| images | Array<string | CommentImage> | () : Array<string | CommentImage> => as Array<string | CommentImage> | - | N |
| videos | Array<CommentVideo> | () : Array<CommentVideo> => as Array<CommentVideo> | - | N |
| reply | string | '' | - | N |
| liked | boolean | false | - | N |
| info | CommentInfo | () : CommentInfo => ({ | - | N |
| follow | CommentFollow | - | - | N |
| headerType | string | - | - | N |
| imagesRows | string | - | - | N |
| ellipsis | string | number | boolean | - | - | N |
| operation | Array<string> | - | - | N |
| customStyle | string | - | 自定义样式 | N |
Comment Events
| 名称 | 参数 | 描述 |
|---|---|---|
| click | info: CommentInfo | 点击时触发 |
| like | liked: boolean | - |
| click-operate | operate: string | - |
| click-images | detail: UTSJSONObject | - |
Comment Slots
| 名称 | 描述 |
|---|---|
| commentLabels | - |
| feature | - |
| commentShopReply | - |
