vue iviem UI grid布局
Grid 栅格
概述

我们采用了24栅格系统,将区域进行24等分,这样可以轻松应对大部分布局问题。使用栅格系统进行网页布局,可以使页面排版美观、舒适。
我们定义了两个概念,行row和列col,具体使用方法如下:
- 使用
row在水平方向创建一行 - 将一组
col插入在row中 - 在每个
col中,键入自己的内容 - 通过设置
col的span参数,指定跨越的范围,其范围是1到24 - 每个
row中的col总和应该为24
注意:非 template/render 模式下,需使用 i-col。
代码示例



<template>
<Row type="flex">
<Col span="6" order="4">1 | order-4</Col>
<Col span="6" order="3">2 | order-3</Col>
<Col span="6" order="2">3 | order-2</Col>
<Col span="6" order="1">4 | order-1</Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<Row>
<Col span="18" push="6">col-18 | push-6</Col>
<Col span="6" pull="18">col-6 | pull-18</Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<Row>
<Col span="8">col-8</Col>
<Col span="8" offset="8">col-8 | offset-8</Col>
</Row>
<br>
<Row>
<Col span="6" offset="8">col-6 | offset-8</Col>
<Col span="6" offset="4">col-6 | offset-4</Col>
</Row>
<br>
<Row>
<Col span="12" offset="8">col-12 | offset-8</Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<p>子元素向左排列</p>
<Row type="flex" justify="start" class="code-row-bg">
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
</Row>
<p>子元素向右排列</p>
<Row type="flex" justify="end" class="code-row-bg">
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
</Row>
<p>子元素居中排列</p>
<Row type="flex" justify="center" class="code-row-bg">
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
</Row>
<p>子元素等宽排列</p>
<Row type="flex" justify="space-between" class="code-row-bg">
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
</Row>
<p>子元素分散排列</p>
<Row type="flex" justify="space-around" class="code-row-bg">
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
<Col span="4">col-4</Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<p>顶部对齐</p>
<Row type="flex" justify="center" align="top" class="code-row-bg">
<Col span="4"><p style="height: 80px">col-4</p></Col>
<Col span="4"><p style="height: 30px">col-4</p></Col>
<Col span="4"><p style="height: 100px">col-4</p></Col>
<Col span="4"><p style="height: 60px">col-4</p></Col>
</Row>
<p>底部对齐</p>
<Row type="flex" justify="center" align="bottom" class="code-row-bg">
<Col span="4"><p style="height: 80px">col-4</p></Col>
<Col span="4"><p style="height: 30px">col-4</p></Col>
<Col span="4"><p style="height: 100px">col-4</p></Col>
<Col span="4"><p style="height: 60px">col-4</p></Col>
</Row>
<p>居中对齐</p>
<Row type="flex" justify="center" align="middle" class="code-row-bg">
<Col span="4"><p style="height: 80px">col-4</p></Col>
<Col span="4"><p style="height: 30px">col-4</p></Col>
<Col span="4"><p style="height: 100px">col-4</p></Col>
<Col span="4"><p style="height: 60px">col-4</p></Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<Row>
<Col :xs="2" :sm="4" :md="6" :lg="8">Col</Col>
<Col :xs="20" :sm="16" :md="12" :lg="8">Col</Col>
<Col :xs="2" :sm="4" :md="6" :lg="8">Col</Col>
</Row>
</template>
<script>
export default { }
</script>

<template>
<Row>
<Col :xs="{ span: 5, offset: 1 }" :lg="{ span: 6, offset: 2 }">Col</Col>
<Col :xs="{ span: 11, offset: 1 }" :lg="{ span: 6, offset: 2 }">Col</Col>
<Col :xs="{ span: 5, offset: 1 }" :lg="{ span: 6, offset: 2 }">Col</Col>
</Row>
</template>
<script>
export default { }
</script>
API
Row props
|
属性 |
说明 |
类型 |
默认值 |
|---|---|---|---|
|
gutter |
栅格间距,单位 px,左右平分 |
Number |
0 |
|
type |
布局模式,可选值为flex或不选,在现代浏览器下有效 |
String |
- |
|
align |
flex 布局下的垂直对齐方式,可选值为top、middle、bottom |
String |
- |
|
justify |
flex 布局下的水平排列方式,可选值为start、end、center、space-around、space-between |
String |
- |
|
class-name |
自定义的class名称 |
String |
- |
Col props
|
属性 |
说明 |
类型 |
默认值 |
|---|---|---|---|
|
span |
栅格的占位格数,可选值为0~24的整数,为 0 时,相当于display:none |
Number | String |
- |
|
order |
栅格的顺序,在flex布局模式下有效 |
Number | String |
- |
|
offset |
栅格左侧的间隔格数,间隔内不可以有栅格 |
Number | String |
- |
|
push |
栅格向右移动格数 |
Number | String |
- |
|
pull |
栅格向左移动格数 |
Number | String |
- |
|
class-name |
自定义的class名称 |
String |
- |
|
xs |
<768px 响应式栅格,可为栅格数或一个包含其他属性的对象 |
Number | Object |
- |
|
sm |
≥768px 响应式栅格,可为栅格数或一个包含其他属性的对象 |
Number | Object |
- |
|
md |
≥992px 响应式栅格,可为栅格数或一个包含其他属性的对象 |
Number | Object |
- |
|
lg |
≥1200px 响应式栅格,可为栅格数或一个包含其他属性的对象 |
Number | Object |
- |
vue iviem UI grid布局的更多相关文章
- WPF界面设计技巧(9)—使用UI自动化布局
原文:WPF界面设计技巧(9)-使用UI自动化布局 最近一直没时间更新这系列文章,因为我一直在埋头编写我的第一个WPF应用程序:MailMail 今天开始编写附属的加密/解密工具,对UI自动化布局有些 ...
- vue mandmobile ui实现三列列表的方法
vue mandmobile ui实现三列列表的方法 请问这种列表的要用那个组件好呢?Cellitem 只能用到两列,这个要三列的怎么弄?mand的好像没有listview,grid组件的 问了man ...
- VUE常用UI组件插件及框架
UI组件及框架 element - 饿了么出品的Vue2的web UI工具套件 mint-ui - Vue 2的移动UI元素 iview - 基于 Vuejs 的开源 UI 组件库 Keen-UI - ...
- UWP学习记录2-设计和UI之布局
UWP学习记录2-设计和UI之布局 1.导航基础知识 应用里,多个页面会有层次关系或者对等关系.这两种关系,通常在一个复杂应用里都会存在,而关系的选定依据: 对于对等导航,一般用选项卡(tabs)或者 ...
- WPF中Grid布局
WPF中Grid布局XMAl与后台更改,最普通的登录界面为例. <Grid Width="200" Height="100" > <!--定义 ...
- NGUI UI Grid, two column
NGUI UI Grid, two column, set Arrangement Horizontal, Column Limit 2.
- [转]使用CSS3 Grid布局实现内容优先
使用CSS3 Grid布局实现内容优先 http://www.w3cplus.com/css3/css3-grid-layout-module.html 本文由大漠根据Rachel Andrew的& ...
- Kendo Web UI Grid添加一个html控件如(checkbox,button)
在Kendo Web UI Grid增加一个控件如效果图: <div id="grid1"></div><script> $("#gr ...
- wpf后置代码中的Grid布局以及图片路径的设置
之前用Grid练习连连看布局时,遇到了几个困惑.此次就把当时的一些收获写出来,供以后翻看. 图片路径可能比较常用,所以就写在第一个了. 在xaml中,设置图片非常简单,只要把图片拷贝到资源目录(这里假 ...
随机推荐
- 图片识别OCR:
使用Python制作一个简易的OCR图片文字识别工具:键盘上的PrtScr按键+画图工具+百度AI图片识别(账户,调用接口)+python 常见的OCR工具: 1. Microsoft Onenote ...
- 后端——框架——容器框架——spring_core——《官网》阅读笔记——初篇
1.知识体系 spring-core的知识点大概分为以下几个部分 IOC容器 Bean的配置,XML方式和注解方式 Bean的管理,bean的生命周期,bean的作用域等等 与Bean相关联的接口和对 ...
- python练习:编写一个程序,要求用户输入一个整数,然后输出两个整数root和pwr,满足0<pwr<6,并且root**pwr等于用户输入的整数。如果不存在这样一对整数,则输入一条消息进行说明。
python练习:编写一个程序,要求用户输入一个整数,然后输出两个整数root和pwr,满足0<pwr<6,并且root**pwr等于用户输入的整数.如果不存在这样一对整数,则输入一条消息 ...
- java 生成签名文件
如何使用jdk中的keytool.exe生成一个签名文件? 1.通过命令行cmd进入jdk的bin目录下,会发现有一个keytool.exe文件 执行命令:keytool -genkey -alias ...
- WLAN配置SKC
1.关于SKC WLC支持粘滞密钥缓存(Sticky Key Caching,SKC). 通过SKC,客户端为其关联的每个AP接收并存储不同的PMKID. AP还维护发布给客户端的PMKID数据库. ...
- 802.1X高级配置
部署VLAN和ACLCisco Catalyst交换机(认证方)和Cisco ACS(认证服务器)具备动态分配VLAN或者ACL的能力.Cisco ACS可以将某个用户分配给指定的VLAN,或应用AC ...
- lc 0224
目录 ✅ 766. 托普利茨矩阵 描述 解答 cpp py ✅ 566. 重塑矩阵 描述 解答 java py ✅ 637. 二叉树的层平均值 描述 解答 cpp py java 0224 algo ...
- vs2013设置不生成.sdf和ipch文件
转载:https://blog.csdn.net/sinat_23338865/article/details/53393760 使用VS2013建立解决方案时,会生成SolutionName.sdf ...
- php的注释、变量、类型、常量、运算符、比较符、条件语句;
php的注释 1.// 2.# 3./* */ 变量 变量是储存信息的容器: 变量规则: 1.变量以$开头,后面跟名称>>>$sum; 2.变量必须以字母或下滑先开头,不能用数字开 ...
- 【译】索引进阶(十七): SQL SERVER索引最佳实践
[译注:此文为翻译,由于本人水平所限,疏漏在所难免,欢迎探讨指正] 原文链接:传送门. 在本章我们给出一些建议:贯穿本系列我们提取出了十四条基本指南,这些基本的指南将会帮助你为你的数据库创建最佳的索引 ...