# @ebay/ebayui-core 中文文档

规范地址：https://npmcn.com/package/%40ebay/ebayui-core/

版本：16\.19\.2
npm 元数据更新时间：2026-10-30T20:58:48.209Z
中文译文更新时间：2026-11-13T04:30:05.178Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40ebay/ebayui-core
原文对照：https://npmcn.com/package/%40ebay/ebayui-core/?lang=original
项目主页：https://github.com/eBay/evo-web#readme
源码仓库：https://github.com/eBay/evo-web

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：11.4 MB，9380 个文件
- TypeScript 类型：未声明
- 运行依赖：15 个
- peer 依赖：marko ^5\.38\.38，@ebay/skin ^19
- 首次发布：2018-03-08T19:57:13.413Z
- 最新版本发布：2026-10-30T20:58:47.846Z
- 近 30 天下载量：3437（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：560（近 12 个月 44 个）

## 中文简介

收集核心eBay组件;被认为是所有复合结构,页面和app的构件.

## 安装

```sh
npm install @ebay/ebayui-core
```

也可以使用：`pnpm add @ebay/ebayui-core`、`yarn add @ebay/ebayui-core`、`bun add @ebay/ebayui-core`

## README

[![eBay UI CI](https://github.com/eBay/evo-web/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/eBay/evo-web/actions/workflows/node.js.yml) [![Coverage Status](https://coveralls.io/repos/github/eBay/ebayui-core/badge.svg?branch=master)](https://coveralls.io/github/eBay/ebayui-core?branch=master)

# eBayUI 核心项目

> Marko部件集;被认为是所有eBay组件,页面和app的核心构件.

## 所需资源

-   [节点.js](https://nodejs.org/en/)
-   [马可](https://markojs.com/) (v4+) (简体中文)
-   [eBay 皮肤](https://ebay.github.io/evo-web/packages/skin) (v19+) (中文(简体) )

_说明:eBayUI 核心部分使用马尔科旗帜,因此需要 `<lasso-page/>` 将添加到任何含有核心组件的页面._

_说明: `@ebay/skin/global` 财务报告和审定财务报表 `@ebay/skin/marketsans` 用于所有模块正确加载._

_注:为使分布属性正常工作, `marko@4.18.22` 至少必须_

### 浏览器策略

所有组件都开发并测试了交叉浏览器

### 无障碍(A11Y)

我们非常重视无障碍环境。 非常认真。 因此,所有部件都按照 [eBay MIND 模式](https://ebay.gitbooks.io/mindpatterns/content/)这些模式又取而代之,取而代之的是: [WAI-ARIA 作者惯例](https://w3c.github.io/aria-practices/)。 。 。 .

构件采用分层、逐步加强的方式,利用下列资源:

-   [骨头 (HTML)](https://github.com/ianmcburnie/bones)
-   [eBay 皮肤( CSS)](https://github.com/eBay/evo-web/packages/skin)
-   [化妆 JS (贾瓦脚本)](https://github.com/makeup-js)

每一层都尽其所能强制和加强无障碍。 我们认为,这种支持水平是我们的主要销售点之一,我们希望你也这样做!

## 构成部分

-   [`ebay-3d-viewer`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-3d-viewer)
-   [`ebay-alert-dialog`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-alert-dialog)
-   [`ebay-avatar`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-avatar)
-   [`ebay-badge`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-badge)
-   [`ebay-breadcrumbs`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-breadcrumbs)
-   [`ebay-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-button)
-   [`ebay-calendar`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-calendar)
-   [`ebay-carousel`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-carousel)
-   [`ebay-character-count`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-character-count)
-   [`ebay-checkbox`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-checkbox)
-   [`ebay-chip`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-chip)
-   [`ebay-combobox`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-combobox)
-   [`ebay-cta-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-cta-button)
-   [`ebay-date-textbox`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-date-textbox)
-   [`ebay-details`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-details)
-   [`ebay-drawer-dialog-deprecated`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-drawer-dialog-deprecated)
-   [`ebay-eek`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-eek)
-   [`ebay-fake-link`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-fake-link)
-   [`ebay-fake-menu`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-fake-menu)
-   [`ebay-fake-menu-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-fake-menu-button)
-   [`ebay-fake-tabs`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-fake-tabs)
-   [`ebay-filter`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-filter)
-   [`ebay-filter-input`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-filter-input)
-   [`ebay-filter-menu`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-filter-menu)
-   [`ebay-filter-menu-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-filter-menu-button)
-   [`ebay-fullscreen-dialog-deprecated`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-fullscreen-dialog-deprecated)
-   [`ebay-icon`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-icon)
-   [`ebay-icon-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-icon-button)
-   [`ebay-infotip`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-infotip)
-   [`ebay-inline-notice`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-inline-notice)
-   [`ebay-lightbox-dialog`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-lightbox-dialog)
-   [`ebay-list`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-list)
-   [`ebay-listbox-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-listbox-button)
-   [`ebay-menu`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-menu)
-   [`ebay-menu-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-menu-button)
-   [`ebay-page-notice`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-page-notice)
-   [`ebay-pagination`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-pagination)
-   [`ebay-panel-dialog`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-panel-dialog)
-   [`ebay-phone-input`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-phone-input)
-   [`ebay-progress-bar`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-progress-bar)
-   [`ebay-progress-bar-expressive`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-progress-bar-expressive)
-   [`ebay-progress-spinner`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-progress-spinner)
-   [`ebay-progress-stepper`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-progress-stepper)
-   [`ebay-radio`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-radio)
-   [`ebay-section-notice`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-section-notice)
-   [`ebay-section-title`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-section-title)
-   [`ebay-segmented-buttons`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-segmented-buttons)
-   [`ebay-select`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-select)
-   [`ebay-signal`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-signal)
-   [`ebay-skeleton`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-skeleton)
-   [`ebay-snackbar-dialog`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-snackbar-dialog)
-   [`ebay-split-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-split-button)
-   [`ebay-star-rating`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-star-rating)
-   [`ebay-star-rating-select`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-star-rating-select)
-   [`ebay-switch`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-switch)
-   [`ebay-tabs`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-tabs)
-   [`ebay-textbox`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-textbox)
-   [`ebay-toast-dialog`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-toast-dialog)
-   [`ebay-toggle-button`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-toggle-button)
-   [`ebay-toggle-button-group`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-toggle-button-group)
-   [`ebay-tooltip`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-tooltip)
-   [`ebay-tourtip`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-tourtip)
-   [`ebay-tri-state-checkbox`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-tri-state-checkbox)
-   [`ebay-video`](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/src/components/ebay-video)

## 开始

EBayUI核心组件作为 `@ebay/ebayui-core` 打开软件包 [国家预防机制](https://www.npmjs.com/package/@ebay/ebayui-core)。 。 。 .

使用 npm 或 线条将包依赖性添加到您的工程中 :

```sh
npm add @ebay/ebayui-core
```

## 升级到最新版本

见 [升级指南](https://github.com/eBay/evo-web/tree/master/packages/ebayui-core/UPGRADE.md) 更多信息

### 自定义标记

一旦添加了软件包依赖性, eBay [海关标记](https://markojs.com/docs/custom-tags/) 现在可以在您的Marko模板中使用。 例如,使用 `ebay-menu` 组件 :

#### _模板.marko_

```marko
<ebay-menu text="Sort" type="radio">
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</ebay-menu>
```

### 属性

属性为组件提供初始状态。 我们可以看到菜单有 `text` 财务报告和审定财务报表 `type` 属性 :

#### _模板.marko_

```marko
<ebay-menu text="Sort" type="radio">
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</ebay-menu>
```

将新的属性传递给ebayui组件将永远重置为内部状态. 如果您想要自己坚持这个状态, 事件会被曝光, 允许您同步状态到自己的组件, 例如:

```marko
class {
    onCreate() {
        this.state = {
            dialogIsOpen: false,
        };
    }

    handleDialogClose() {
        this.state.dialogIsOpen = false;
    }

    handleDialogOpen() {
        this.state.dialogIsOpen = true;
    }
}

<ebay-lightbox-dialog
    open=state.dialogIsOpen
    on-open("handleDialogOpen")
    on-close("handleDialogClose")
>
    ...
</ebay-lightbox-dialog>
```

#### 通过属性

HTML属性可以用于任何组件上,它们会被传递到组件最突出的标记上. 最突出的标记通常是根或形式控件,但单个组件如果因特定情况而异会注意.

静态使用示例:

```marko
<ebay-button id="my-button"/>
```

为了动态地使用通过属性,它们应当通过 `html-attributes` 属性 :

```marko
$ const myAttributes = { id: "my-button" };
<ebay-button html-attributes=myAttributes/>
```

静态和动态的通过属性可以同时使用(html属性在冲突中优先):

```marko
$ const myAttributes = { id: "my-button" };
<ebay-button html-attributes=myAttributes type="submit"/>
```

### 活动

事件也可以使用 [马尔科语法](https://markojs.com/docs/events/)数字 :

#### _模板.marko_

```marko
<ebay-menu text="Sort" type="radio" on-change("onMenuChange")>
    <@item>Price</@item>
    <@item>Time</@item>
    <@item>Distance</@item>
</ebay-menu>
```

## 释放里程碑( M)

关于即将印发的路线图和历史,请参见我们 [释放](https://github.com/eBay/evo-web/releases) 财务报告和审定财务报表 [里程碑](https://github.com/eBay/evo-web/milestones) 页面.

### 版本

Ebayui核心套件严格遵循 [语义版本](http://semver.org/)。 。 。 .

给一个版本号 MAJOR.MINOR.PATCH:

-   当我们进行不相容的 API 修改时, MaJOR 版本会递增
-   MINOR 版本在以倒向兼容方式添加功能时会递增
-   PATCH版本在做回相容的bug修正时会递增.

### 折旧

折旧将通过下列途径通报: [发布注释](https://github.com/eBay/evo-web/releases)请仔细阅读 一般来说,期望在下一个主要版本中去掉任何被贬损的特性. 然而,在某些情况下,我们可能等待一段时间.

### 问题

请用我们的 [问题页面](https://github.com/eBay/evo-web/issues) 询问、报告问题或提交特征请求.

为了帮助追踪您的问题, 我们的管理员会给它分配一个或多个有色标签:

-   黑色: 问题类型( 如错误、 问题、 测试大小写)
-   白色: 分辨率( 如 wont fix, 无效, 重复)
-   Gray:状态(例如积压,正在进行中,需要帮助)
-   红色:块状物(如依赖,讨论,设计等)
-   绿色:模块(例如按钮、收音机、对话框)
-   蓝色:外观(例如:构建、文档、网站)
-   黄色: semver 向导( 如: 打破更改, 向后兼容)
-   紫色:冲刺(如冲刺1,冲刺2等)

## 捐款

想要为eBay UI做贡献吗? 请来看我们 [贡献页](https://npmcn.com/package/%40ebay/ebayui-core/CONTRIBUTING.md) 更多信息.

## 许可证

版权 (c) 2018 eBay Inc.

使用此源代码受麻省理工学院风格许可的规范,该许可可在LICENSE文件中找到,也可在 [https://opensource.org/licenses/MIT (中文(简体) )](https://opensource.org/licenses/MIT)。 。 。 .

使用一些需要第三方提供单独、非公开资源的限制的构成部分

EBayUI库中的数据可视化组件和图表组件被设计为使用一个或多个HighCharts®软件产品. HighCharts是HighSoft AS的注册商标. HighSoft AS不隶属于埃拜公司. Ebay对于数据可视化组件和图表组件设计要使用的High Charts 软件产品,不提供任何种类的保证(例如,为特定目的的可商性、健身性和不侵犯性),无论是明示的还是默示的.

商业使用高科技产品需要高科技公司提供的优惠。 虽然eBayUI图书馆的许多组件根据麻省理工学院许可证获得许可,但设计用于EbayUI图书馆的数据可视化组件和图表组件的高图软件产品则根据麻省理工学院许可证或任何其他开源许可证不获得许可。 与HighHarts 软件产品有关的权利(例如,包括但不限于使用、安装、分发、公布、合并、复制和修改的权利),由在线提供的一项或多项专利许可协议的条款管辖 [http://www.highcharts.com (中文(简体) )](http://www.highcharts.com/) 或根据海关许可协议的条款,HighSoft AS可自行决定与客户谈判。 HighSoft AS可能选择免费为HighHarts 软件产品非商业用途发放许可证,但它是希望使用HighCHARTS SOFTWARE 产品的任何缔约方的责任,以使用HHASTAFT 的特性。 不属于这种限制范围的缔约方,因为高压产品(或其供应者或导弹)不能使用高压产品,因此不能使用数据访问成分和易控液化成分.

这一通知应载入软件的所有副本或大部分.

## 常见问题

### @ebay/ebayui-core 是什么？

收集核心eBay组件;被认为是所有复合结构,页面和app的构件\.

### 如何安装 @ebay/ebayui-core？

在项目目录运行 npm install @ebay/ebayui-core，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：marko（^5\.38\.38）、@ebay/skin（^19）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @ebay/ebayui-core 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/ebay\_\_ebayui-core 是否存在。

### @ebay/ebayui-core 可以商用吗？

@ebay/ebayui-core 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @ebay/ebayui-core 的下载量有多少？

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

### @ebay/ebayui-core 还在维护吗？

最新版本 16\.19\.2 发布于 2026/10/31（13 天前）；至今共发布 560 个版本，其中过去 12 个月发布了 44 个；首次发布于 2018/03/09。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

