@financial-times/community-event-teaser

中文文档
11.7.4发布于 2026/11/11ISCCommonJS近 30 天下载 2173

社区活动取笑者等

中文使用文档
文档目录6 节
  1. 说明
  2. 说明
  3. 安装
  4. 使用量
  5. 发展
  6. 创造本地环境

社区活动

故事书: https://jubilant-umbrella-dd461ca9. pages.github.io 互联网档案馆的存檔,存档日期2013-12-22

说明

  • 这是一个包含事件UI组件的软件包 .
  • 社区活动提炼器提供了制作这些元素 EventTeaser, (中文(简体) ), EventTopicCardItem,以及 EventPromo
  • 社区活动提炼器还提供两个用益功能的导出: liveEventToEventTeaserProps,以及 initTeaserTracking

说明

  • 这个 initTeaserTracking 正在使用函数所传递的 oTracking 的引用 。 该软件包经过测试并与来自 4.0.0 改为 4.4.0。 。 。 .

安装

npm install @financial-times/community-event-teaser

使用量

  • 如何使用 <EventTeaser/>

    import { h, render } from '@financial-times/x-engine';
    import { EventTeaser } from "@financial-times/community-event-teaser";
    
    const container = document.querySelector('.some-container-element');
    
    render((
      <EventTeaser
        imgUrl={"https://ftweekend.live.ft.com/some-cool-image-png"}
        title={"FTWeekend Festival"}
        standfirst={"Some short description of the event"}
        eventUrl={"https://ftweekend.live.ft.com"}
        lazyLoadImage={"some__lazy-loading-classname"}
        location={"Kenwood House Gardens & Online"}
        scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
        showImage={true}
        showBrand={true}
        showStandfirst={true}
      />), container)
    
  • 如何使用 EventTopicCardItem

    import { h, render } from '@financial-times/x-engine';
    import { EventTopicCardItem } from "@financial-times/community-event-teaser";
    
    const container = document.querySelector('.some-container-element');
    
    render((
      <EventTopicCardItem
        title={"FTWeekend Festival"}
        eventUrl={"https://ftweekend.live.ft.com"}
        location={"Kenwood House Gardens & Online"}
        scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
      />), container)
    

发展

创造本地环境

  • 简单地复制这个 repo, cd 进入目录并运行:
npm install

版本与发布记录

@financial-times/community-event-teaser 共发布 254 个版本,首次发布于 2021/08/24;过去 12 个月发布了 22 个版本。

版本发布日期距今
11.7.4latest2026/11/113 天前
11.7.4-alpha.2794.1pre-release2026/11/113 天前
11.7.4-alpha.2794.02026/11/113 天前
11.7.32026/10/2124 天前
11.7.3-alpha.2752.12026/10/2124 天前
11.7.3-alpha.2752.02026/10/2025 天前

关于 @financial-times/community-event-teaser 的常见问题

@financial-times/community-event-teaser 是什么?

社区活动取笑者等

如何安装 @financial-times/community-event-teaser?

在项目目录运行 npm install @financial-times/community-event-teaser,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:ftdomdelegate(^5.0.0)、@financial-times/o-grid(^6.0.0)、@financial-times/sass-mq(^5.0.0)、@financial-times/x-engine(>=6.0.0)、@financial-times/o-tracking(^4.5.0)、@financial-times/o3-foundation(^3.2.1)、@financial-times/ft-date-format(^2.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@financial-times/community-event-teaser 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/financial-times__community-event-teaser 是否存在。

@financial-times/community-event-teaser 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@financial-times/community-event-teaser 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 20.x。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@financial-times/community-event-teaser 可以商用吗?

@financial-times/community-event-teaser 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@financial-times/community-event-teaser 的下载量有多少?

根据 npm 官方下载统计,@financial-times/community-event-teaser 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,173 次,日均约 72 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@financial-times/community-event-teaser 还在维护吗?

最新版本 11.7.4 发布于 2026/11/11(3 天前);至今共发布 254 个版本,其中过去 12 个月发布了 22 个;首次发布于 2021/08/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。