# @egjs/vue-grid 中文文档

规范地址：https://npmcn.com/package/%40egjs/vue-grid/

版本：1\.18\.1
npm 元数据更新时间：2026-10-30T07:12:07.757Z
中文译文更新时间：2026-11-13T09:31:50.804Z
软件包许可：未声明

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

原始 npm 页面：https://www.npmjs.com/package/%40egjs/vue-grid
原文对照：https://npmcn.com/package/%40egjs/vue-grid/?lang=original
项目主页：https://naver.github.io/egjs-grid
源码仓库：https://github.com/naver/egjs-grid#main

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

- 包体积（解压后）：43.7 kB，31 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：vue \>=2\.0\.0
- 首次发布：2021-03-26T05:11:38.616Z
- 最新版本发布：2026-10-30T07:12:07.579Z
- 近 30 天下载量：5430（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：36（近 12 个月 2 个）

## 中文简介

能够根据网格类型排列项目的 Vue 组件

## 安装

```sh
npm install @egjs/vue-grid
```

也可以使用：`pnpm add @egjs/vue-grid`、`yarn add @egjs/vue-grid`、`bun add @egjs/vue-grid`

## README

![](https://naver.github.io/egjs-grid/images/logo.png)

## Vue 网格

[![npm version](https://img.shields.io/npm/v/@egjs/vue-grid.svg?style=flat-square&color=007acc&label=version)](https://www.npmjs.com/package/@egjs/vue-grid)  ![](https://img.shields.io/badge/language-typescript-blue.svg?style=flat-square)  [![](https://img.shields.io/static/v1?style=flat-square&label=license&message=MIT&color=08CE5D)](https://github.com/naver/egjs-grid/blob/main/LICENSE) 

Vue 组件,可以根据网格类型排列项目.

[**演示**](https://naver.github.io/egjs-grid) 编号 :  [**API 密码**](https://naver.github.io/egjs-grid/release/latest/doc/)

## 网格

| ![](https://naver.github.io/egjs-grid/images/MasonryGrid.png) | ![](https://naver.github.io/egjs-grid/images/JustifiedGrid.png) | ![](https://naver.github.io/egjs-grid/images/FrameGrid.png) | ![](https://naver.github.io/egjs-grid/images/PackingGrid.png) |
| :-: | :-: | :-: | :-: |
| [**共济会**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-masonrygrid--masonry-grid-template) | [**说明**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-justifiedgrid--justified-grid-template) | [**框架图形**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-framegrid--frame-grid-template) | [**包装 网格**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-packinggrid--packing-grid-template) |

-   **共济会**: MesonryGrid是一个网格,可以堆放与一叠砖一样宽的物品. 将所有图像的宽度调整到相同的大小,找到最低高度一栏,并插入新项目.
-   **说明**:"正经"是一个印刷名词,意思是"适合一行宽". JustifiedGrid是一个网格,根据给定大小的行来填充项目.
-   **框架图形**:"Frame"是一个印刷名词,意思是"它适合一行宽". FrameGrid是一个网格,根据给定大小的行填充项目.
-   **包装 网格**: PackingGrid是一个显示重要项目较大而不会牺牲项目重量的网格. 将行和列相分离,使项目能动态地被放入水平和垂直空间,而不是有序地排列.

## 文档

-   [启动和演示](https://naver.github.io/egjs-grid/)
-   [API 文档](https://naver.github.io/egjs-grid/release/latest/doc/)

## 下载和安装

从 repo 直接下载 dist 文件或通过 npm 安装它 .

```bash
$ npm install @egjs/vue-grid
```

## 如何使用

```html
<template>
  <masonry-grid
    class="container"
    v-bind:gap="gap"
    v-bind:align="align"
  >
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
  </masonry-grid>
</template>
<script>
import { MasonryGrid, JustifiedGrid, FrameGrid, PackingGrid } from "@egjs/vue-grid";

export default {
  datas: {
    gap: 5,
    align: "justify",
  },
  components: {
    MasonryGrid,
  }
}
</script>
```

#### 2\. 安装依赖关系

```
# Install the dependency modules.
$ npm install
```

### 3个. `npm start`

运行 `storybook` 促进发展.

打开 [http://localhost:6009 (英语)](http://localhost:6009/) 在浏览器中查看.

如果您做了编辑, 页面会重新装入 .  
您也会看到控制台上的任何错误 .

#### 3个. `npm build`

使用 npm 脚本构建网格

```bash
# Build
$ npm run build
```

## 错误报告

如果你发现虫子,请向我们报告 打开一个新的 [问题](https://github.com/naver/egjs-grid/issues) (原始内容存档于2018-09-29). on GitHub.

## 许可证

egjs-grid 发布于 [麻省理工学院许可证](https://github.com/naver/egjs/blob/master/LICENSE.txt)。 。 。 .

```
Copyright (c) 2021-present NAVER Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```

## 常见问题

### @egjs/vue-grid 是什么？

能够根据网格类型排列项目的 Vue 组件

### 如何安装 @egjs/vue-grid？

在项目目录运行 npm install @egjs/vue-grid，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：vue（\>=2\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @egjs/vue-grid 支持 TypeScript 吗？

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

### @egjs/vue-grid 支持 ESM 还是 CommonJS？

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

### @egjs/vue-grid 可以商用吗？

@egjs/vue-grid 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @egjs/vue-grid 的下载量有多少？

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

### @egjs/vue-grid 还在维护吗？

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

