Vuetify 容器最大宽度固定
Vuetify Container max-width fixed
我正在使用 Vue.js 和 Vuetify (https://vuetifyjs.com/en/) 构建一个网络应用程序。
我有一个简单的布局,有 3 列。但是,我希望 3 列填满页面的整个宽度,但是有一个 CSS 的自动片段将 max-width 强制为 960px。这是为什么?如何使用整个屏幕?您也可以在这里查看:https://codepen.io/mlikoga/pen/KeLNvy
<div id="app">
<v-app>
<v-content>
<v-container ma-0 pa-0 fill-height>
<v-layout row>
<v-flex xs4> Chat List </v-flex>
<v-flex xs4> Main Chat</v-flex>
<v-flex xs4> User Profile</v-flex>
</v-layout>
</v-container>
</v-content>
</v-app>
</div>
自动CSS:
@media only screen and (min-width: 960px)
.container {
max-width: 960px;
}
容器的概念在网站布局中非常普遍。默认情况下,Vuetify 使用 'fixed' 容器。 'fluid' 容器将填满视口。
您可以在 Vuetify 容器上将 fluid
属性设置为 true
<v-container>
:
<div id="app">
<v-app>
<v-content>
<v-container fluid ma-0 pa-0 fill-height>
<v-layout row>
<v-flex xs4> Chat List </v-flex>
<v-flex xs4> Main Chat</v-flex>
<v-flex xs4> User Profile</v-flex>
</v-layout>
</v-container>
</v-content>
</v-app>
</div>
这里有一些关于固定容器和流体容器的有用信息:https://www.smashingmagazine.com/2009/06/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/
可在此处找到其他 Vuetify 网格信息:
https://vuetifyjs.com/en/layout/grid
超级简单的答案:与上面的答案类似,但在样式中包含width:100%;因为我的没有它就无法工作。
<template>
<v-container fluid style="margin: 0px; padding: 0px; width: 100%">
<v-layout wrap>
<div class="container">
Content you want in a container as this takes on the container class.
</div>
<div>
Content you don't want contained as it takes on the fluid 100% width.
</div>
</v-layout>
</v-container>
</template>
基本上,您使用 100% 的宽度覆盖整个默认值 v-container。
我正在使用 Vue.js 和 Vuetify (https://vuetifyjs.com/en/) 构建一个网络应用程序。 我有一个简单的布局,有 3 列。但是,我希望 3 列填满页面的整个宽度,但是有一个 CSS 的自动片段将 max-width 强制为 960px。这是为什么?如何使用整个屏幕?您也可以在这里查看:https://codepen.io/mlikoga/pen/KeLNvy
<div id="app">
<v-app>
<v-content>
<v-container ma-0 pa-0 fill-height>
<v-layout row>
<v-flex xs4> Chat List </v-flex>
<v-flex xs4> Main Chat</v-flex>
<v-flex xs4> User Profile</v-flex>
</v-layout>
</v-container>
</v-content>
</v-app>
</div>
自动CSS:
@media only screen and (min-width: 960px)
.container {
max-width: 960px;
}
容器的概念在网站布局中非常普遍。默认情况下,Vuetify 使用 'fixed' 容器。 'fluid' 容器将填满视口。
您可以在 Vuetify 容器上将 fluid
属性设置为 true
<v-container>
:
<div id="app">
<v-app>
<v-content>
<v-container fluid ma-0 pa-0 fill-height>
<v-layout row>
<v-flex xs4> Chat List </v-flex>
<v-flex xs4> Main Chat</v-flex>
<v-flex xs4> User Profile</v-flex>
</v-layout>
</v-container>
</v-content>
</v-app>
</div>
这里有一些关于固定容器和流体容器的有用信息:https://www.smashingmagazine.com/2009/06/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/
可在此处找到其他 Vuetify 网格信息: https://vuetifyjs.com/en/layout/grid
超级简单的答案:与上面的答案类似,但在样式中包含width:100%;因为我的没有它就无法工作。
<template>
<v-container fluid style="margin: 0px; padding: 0px; width: 100%">
<v-layout wrap>
<div class="container">
Content you want in a container as this takes on the container class.
</div>
<div>
Content you don't want contained as it takes on the fluid 100% width.
</div>
</v-layout>
</v-container>
</template>
基本上,您使用 100% 的宽度覆盖整个默认值 v-container。