Twitter 嵌入 TwitterEmbed
TwitterEmbed 允许你轻松地将单条推文或推文列表集成到你的页面中,非常适合收集用户证言或行业动态。
import { TwitterEmbed } from '@goenhance/cms-ui';
const Example = () => ( <TwitterEmbed title="推文展示" list={[ { tweetId: "...", description: "..." } ]} />);属性说明 (Props)
Section titled “属性说明 (Props)”| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
title | string | - | 区域标题 |
list | TwitterEmbedItem[] | [] | 推文数据列表 |
TwitterEmbedItem
Section titled “TwitterEmbedItem”| 属性 | 类型 | 说明 |
|---|---|---|
tweetId | string | 推文 ID |
tweetUrl | string | 推文链接 (用于占位符) |
description | string | 推文描述 (用于加载时的占位显示) |
- 多列瀑布流:在大屏幕下自动以多列布局展示推文,节约纵向空间。
- 渐进增强:加载过程中显示美观的链接占位符,增强用户体验。
- 原生渲染:直接调用 Twitter 官方嵌入脚本,保持样式原汁原味。