# @arc-core-components/element\_image 中文文档

规范地址：https://npmcn.com/package/%40arc-core-components/element_image/

版本：0\.4\.4-beta\.0
npm 元数据更新时间：2022-09-26T12:46:49.591Z
中文译文更新时间：2026-11-06T13:53:41.173Z
软件包许可：ISC

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

原始 npm 页面：https://www.npmjs.com/package/%40arc-core-components/element_image
原文对照：https://npmcn.com/package/%40arc-core-components/element_image/?lang=original
源码仓库：https://github.com/wapopartners/core-components/packages/element_image

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

- 包体积（解压后）：28.8 kB，8 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：1 个
- peer 依赖：enzyme \>=3，prop-types \>=15，react \>=16
- 首次发布：2018-09-19T19:44:15.774Z
- 最新版本发布：2019-11-08T16:56:39.519Z
- 近 30 天下载量：3193（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：30（近 12 个月 0 个）

## 中文简介

作为Arc Core组件的简单图像.

## 安装

```sh
npm install @arc-core-components/element_image
```

也可以使用：`pnpm add @arc-core-components/element_image`、`yarn add @arc-core-components/element_image`、`bun add @arc-core-components/element_image`

## README

## 元素: 图像

# 这有什么用?

当在聚合项目中使用时,该核心组件可用于制取 图像.

_这些道具是根据内容的结构自动设置的:_

-   `url` (单位:千美元) `src` 图像)
-   `caption` (还将用作 `alt`(中文(简体) )
-   `credits`

_这些显示道具是可选的 :_

-   `className` (适用于集装箱)
-   `imgClassName` (适用于 `img` 要素)
-   `captionClassName` (适用于标题容器)
-   `creditsClassName` (适用于信贷集装箱)
-   `placeholderImage` (如果没有) `url` ,该占位符 URL 已提供)
-   `separator` (字符串用作信用之间的分隔符,默认"q")
-   `showCredits` (一组) `false` (以隐藏信用)
-   `sizePreset` (交出一个重新大小的图像 - 见 [aPI 核心组件文件](https://github.com/wapopartners/core-components/tree/dev/packages/content-source_content-api-v4) 用于更多再密钥配置信息)

# 我该怎么用?

```javascript
import Image from "@arc-core-components/element_image";

<Image {...imageContentElement} className="your-classes" />;
```

看看这个 `src` 文档以查看建议的执行,在 [指数.mdx](https://npmcn.com/package/%40arc-core-components/element_image/index.mdx)

# 我怎么能快速看到里面的东西?

运行 `npm i && npm run docz:dev` 克隆后看里面有什么.

# 测试和 Linting

我们正在使用 Jest 和 XO 测试和闪烁.

我们利用Husky来运行一个预推钩, 防止未被打开或代码 测试失败,无法进入重播.

**测试:** `npm test`

**给 :** `npm run lint` - 这也会解决任何简单的通关错误 自动.

**不经过测试或打磨**数字 : `git push --no-verify` - 经常这样 如果你只需要推一枝树枝 用于示范目的或 帮助.

## 常见问题

### @arc-core-components/element\_image 是什么？

作为Arc Core组件的简单图像\.

### 如何安装 @arc-core-components/element\_image？

在项目目录运行 npm install @arc-core-components/element\_image，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：enzyme（\>=3）、prop-types（\>=15）、react（\>=16）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @arc-core-components/element\_image 支持 TypeScript 吗？

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

### @arc-core-components/element\_image 支持 ESM 还是 CommonJS？

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

### @arc-core-components/element\_image 可以商用吗？

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

### @arc-core-components/element\_image 的下载量有多少？

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

### @arc-core-components/element\_image 还在维护吗？

最新版本 0\.4\.4-beta\.0 发布于 2019/11/09（6 年前）；至今共发布 30 个版本，其中过去 12 个月发布了 0 个；首次发布于 2018/09/20。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

