内容简介:Flexbox 對於macOS Mojave 10.14.5Node 12.4.0
Flexbox 對於 間隔等距 ,主要由 justify-content 的 space 系列設定;Vuetify 的 Grid 則提供 justify-space-between 與 justify-space-around 等 props,讓我們不用 CSS 即可排版。
Version
macOS Mojave 10.14.5
Node 12.4.0
Vue CLI 3.8.4
Vue 2.6.10
Vuetify 1.5.5
Chrome 75.0.3770.100
Vue File
<template>
<v-container fluid>
<v-layout justify-space-between row1>
<v-flex xs4 item1>1</v-flex>
<v-flex xs3 item2>2</v-flex>
<v-flex xs4 item3>3</v-flex>
</v-layout>
</v-container>
</template>
<script>
export default {
name: 'App',
}
</script>
<style scoped>
.row1 {
background-color: #d3d3d3;
height: 240px;
}
.item1 {
background-color: #faa;
}
.item2 {
background-color: #afa;
}
.item3 {
background-color: #aff;
}
</style>
第 2 行
<v-container fluid>
<v-layout justify-space-between row1>
<v-flex xs4 item1>1</v-flex>
<v-flex xs3 item2>2</v-flex>
<v-flex xs4 item3>3</v-flex>
</v-layout>
</v-container>
對 3 個 <div> 做 layout。
但已經看不到 <div> 與 CSS class,取而代之是 Vuetify 的 component 與 props。
Space Between
RGB 並沒有均分 container,但 紫色 間距是相等的。
<v-container fluid>
<v-layout justify-space-between row1>
<v-flex xs4 item1>1</v-flex>
<v-flex xs3 item2>2</v-flex>
<v-flex xs4 item3>3</v-flex>
</v-layout>
</v-container>
Vuetify 的 grid system 依次使用 <v-container> 、 <v-layout> 與 <v-flex> 。
<v-layout> 相當於 CSS 的 display: flex 。
若 <v-layout> 沒設定 column props,預設為 row ,表示內容 由左至右 。
justify-space-between 表示:
-
<v-flex>與<v-flex>間隔平分<v-container>剩下寬度 - 第一個
<v-flex>與最後一個<v-flex>都貼齊<v-container>,不使用<v-container>剩下寬度
justify-space-between 相當於 CSS 的 justify-content: space-between 。
Space Around
RGB 並沒有均分 container,兩側間距為中間間距的一半。
<v-container fluid>
<v-layout justify-space-around row1>
<v-flex xs4 item1>1</v-flex>
<v-flex xs3 item2>2</v-flex>
<v-flex xs4 item3>3</v-flex>
</v-layout>
</v-container>
justify-space-around 表示:
-
<v-flex>與<v-flex>間隔平分 container 剩下寬度 - 第一個
<v-flex>與最後一個<v-flex>也會使用<v-container>剩下寬度,但只有<v-flex>與<v-flex>間寬度一半
justify-space-around 相當於 CSS 的 justify-content: space-around 。
Space Evenly
RGB 並沒有均分 container,兩側間距與中間間距相同。
<v-container fluid>
<v-layout justify-space-evenly row1>
<v-flex xs4 item1>1</v-flex>
<v-flex xs3 item2>2</v-flex>
<v-flex xs4 item3>3</v-flex>
</v-layout>
</v-container>
justify-space-evenly 表示:
-
<v-flex>與<v-flex>間隔平分v-container剩下寬度 - 第一個
<v-flex>與最後一個<v-flex>也會使用<v-container>剩下寬度,與<v-flex>與<v-flex>間寬度相等
<style scoped>
.justify-space-evenly {
justify-content: space-evenly;
}
</style>
Vuetify 目前並沒有提供 justify-space-evenly props,若要達成相同效果,只能自己定義 justify-space-evenly class。
使用自行定義的 justify-space-evenly class。
Conclusion
- 實務上
justify-space-between與justify-space-around較常使用,也因此 Vuetify 沒有提供justify-space-evenly
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
虚拟现实:最后的传播
聂有兵 / 中国发展出版社 / 2017-4-1 / 39.00
本书对“虚拟现实”这一诞生自70年代却在今天成为热门话题的概念进行了历史发展式的分析和回顾,认为虚拟现实是当今最重大的社会变革的技术因素之一,对虚拟现实在未来百年可能给人类社会的各个层面带来的影响进行说明,结合多个大众媒介的发展趋势,合理地推演未来虚拟现实在政治、经济、文化等领域的态势,并基于传播学理论框架提出了几个新的观点。对于普通读者,本书可以普及一般的虚拟现实知识;对于传媒行业,本书可以引导......一起来看看 《虚拟现实:最后的传播》 这本书的介绍吧!