内容沉淀
bnpm搜索:@byted-ent/publicity-rl3
本文档提供了
ContentAccumulation React组件的详细使用说明和API参考。是一个高级别的“内容沉淀”聚合模块,专为展示用户的个人动态和资产而设计。它通常作为“我的”页面的核心部分,内部集成了动态列表(我发布的)和资产列表(我加入的)。Props API
组件接受以下 props 来控制其行为和外观:
参数 | 说明 | 类型 | 是否必传 |
listType | 列表类型 | "circle" | "published" | 否,默认值展示published |
loading | 列表是否处于loading状态 | boolean | 否,默认值为false |
hasMore | 是否存在更多列表数据 | boolean | 否,默认值为false |
dataSource | 数据列表,用于渲染每个列表的 | Array<ItemInfo> | 否,如果不传展示默认已发布数据 |
isError | 是否进入错误兜底页 | boolean | 否,默认值为false |
ItemInfo
具体卡片数据格式参考服务端下发aweme_content、comment_content等卡片参数超过100个字段,不建议手动拼接,以服务端下发为准;
参数 | 说明 | 类型 | 是否必传 |
item_type | 卡片类型 VideoOrImages = 1, Comment = 2, JoinFandom = 3, | number | 是 |
aweme_content | 图文 & 视频卡数据格式 | AwemeBaseStruct | 否 |
comment_content | 评论卡数据格式 | Discussion | 否 |
join_info | 加入圈子卡数据格式 | { fandom_id: string; avatar: UrlStruct; title: string; join_user_cnt: number; hot_value: number; has_signed: number; } | 否 |
Events API
事件名 | 说明 | 回调参数 |
onLoadMore | 滚动触底加载更多 | |
onRetry | 网络错误态下点击重试 | |
基本用法
下面是一个基础的
ContentAccumulation 组件使用示例,展示了如何渲染一个基本的内容沉淀组件。<ContentAccumulation tabList=['我发布的', '我加入的'] dataList=[[{ item_type: 1, aweme_content: xxx, },{ ... } ]] />
