
Vue 网格
Vue 组件,可以根据网格类型排列项目.
网格
![]() | ![]() | ![]() | ![]() |
|---|---|---|---|
| 共济会 | 说明 | 框架图形 | 包装 网格 |
- 共济会: MesonryGrid是一个网格,可以堆放与一叠砖一样宽的物品. 将所有图像的宽度调整到相同的大小,找到最低高度一栏,并插入新项目.
- 说明:"正经"是一个印刷名词,意思是"适合一行宽". JustifiedGrid是一个网格,根据给定大小的行来填充项目.
- 框架图形:"Frame"是一个印刷名词,意思是"它适合一行宽". FrameGrid是一个网格,根据给定大小的行填充项目.
- 包装 网格: PackingGrid是一个显示重要项目较大而不会牺牲项目重量的网格. 将行和列相分离,使项目能动态地被放入水平和垂直空间,而不是有序地排列.
文档
下载和安装
从 repo 直接下载 dist 文件或通过 npm 安装它 .
$ npm install @egjs/vue-grid
如何使用
<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 (英语) 在浏览器中查看.
如果您做了编辑, 页面会重新装入 .
您也会看到控制台上的任何错误 .
3个. npm build
使用 npm 脚本构建网格
# Build
$ npm run build
错误报告
如果你发现虫子,请向我们报告 打开一个新的 问题 (原始内容存档于2018-09-29). on GitHub.
许可证
egjs-grid 发布于 麻省理工学院许可证。 。 。 .
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.



