# @shopware-ag/meteor-component-library 中文文档

规范地址：https://npmcn.com/package/%40shopware-ag/meteor-component-library/

版本：5\.9\.0
npm 元数据更新时间：2026-11-02T10:17:33.517Z
中文译文更新时间：2026-11-02T11:30:20.836Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40shopware-ag/meteor-component-library
原文对照：https://npmcn.com/package/%40shopware-ag/meteor-component-library/?lang=original
项目主页：https://github.com/shopware/meteor#readme
源码仓库：https://github.com/shopware/meteor

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

- 包体积（解压后）：17.1 MB，2584 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：45 个
- 首次发布：2022-08-09T09:01:10.442Z
- 最新版本发布：2026-11-02T10:17:33.058Z
- 已发布版本数：92（近 12 个月 31 个）

## 中文简介

meteor组件库是由Shopware开发的一个Vue组件库。它是基于 [流星设计系统](https://shopware.design/).

## 安装

```sh
npm install @shopware-ag/meteor-component-library
```

也可以使用：`pnpm add @shopware-ag/meteor-component-library`、`yarn add @shopware-ag/meteor-component-library`、`bun add @shopware-ag/meteor-component-library`

## README

# 流星组件库

meteor组件库是由Shopware开发的一个Vue组件库。它是基于 [流星设计系统](https://shopware.design/).

-   完美适用于Shopware应用程序
-   匹配Shopware管理的外观和感觉
-   小捆大小与摇树
-   通过Storybook测试和预览， [记录](https://meteor.shopware.com/) 在meteor.shopware.com上

## 要求

你需要工作 **v3应用程序** 与 **i18n插件** 翻译。主要的翻译（英语和德语）被捆绑在组件中。对于其他语言，您需要为正确的路径添加代码片段。

## 安装

将这些包添加到您的项目中：

```cli
npm i @shopware-ag/meteor-component-library vue-i18n
```

导入 `style.css` 一般的造型和 `font.css` 在应用程序的根文件或根样式文件中查找Inter字体。

```js
import "@shopware-ag/meteor-component-library/styles.css";
import "@shopware-ag/meteor-component-library/font.css";
```

现在，为Vue配置i18n插件。

```js
const i18n = createI18n({
  legacy: false,
});

app.use(i18n);
```

每个组件都独立工作，可以像这样直接从根目录导入：

```html
<script>
  import { MtButton } from "@shopware-ag/meteor-component-library";

  export default {
    components: {
      "mt-button": MtButton,
    },
  };
</script>
```

## 开发

如果您想贡献这个组件库，这些指南非常有用。

### 项目设置

```shell
pnpm install
```

#### 编译和热加载用于开发

```shell
pnpm run storybook
```

要同时运行Storybook和文档站点，请使用 `pnpm dev` 而是从存储库根目录。看到 [贡献指南](https://npmcn.com/package/CONTRIBUTING.md#running-storybook-and-the-documentation) 获取详细信息。

#### 编译和最小化产品

```shell
pnpm run build:storybook
```

#### 运行您的交互测试（需要运行Storybook实例）

```shell
pnpm run test:storybook
```

#### 检查和修复文件

```shell
pnpm run lint:all
```

#### 构建绑定的组件库

```shell
pnpm run build
```

### 编写交互测试

所有的交互测试都是用 `component-name.interactive.stories.js` 文件。标题需要加前缀 `Interaction Tests/`． 这些交互测试隐藏在最终构建中，但在Storybook开发观察器中是可见的。

例子:

```js
import meta from "./mt-button.stories";

export default {
  ...meta,
  title: "Interaction Tests/base/mt-button",
  component: MtButton,
};
```

### 编写视觉测试

视觉测试需要从故事开始 `VisualTest`.

例子:

```js
export const VisualTestPrimaryVariant = {
  name: "Render the primary variant",
  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement);

    // your interaction test ...
  },
};
```

屏幕截图将在播放功能结束时生成。如果没有定义Play函数，那么它将立即被创建。

为了减少片状，所有动画都自动从剧作家禁用。

## 常见问题

### @shopware-ag/meteor-component-library 是什么？

meteor组件库是由Shopware开发的一个Vue组件库。它是基于 流星设计系统\.

### 如何安装 @shopware-ag/meteor-component-library？

在项目目录运行 npm install @shopware-ag/meteor-component-library，或使用 pnpm add / yarn add / bun add。

### @shopware-ag/meteor-component-library 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @shopware-ag/meteor-component-library 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @shopware-ag/meteor-component-library 可以商用吗？

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

### @shopware-ag/meteor-component-library 还在维护吗？

最新版本 5\.9\.0 发布于 2026/11/02（1 天前）；至今共发布 92 个版本，其中过去 12 个月发布了 31 个；首次发布于 2022/08/09。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

