【发布时间】:2019-06-02 17:46:53
【问题描述】:
我有 2 个需要固定大小的 html 组件。 1 是v-list 另一个是可视化编辑器。如果v-list 太大,页面上会出现滚动条。为了解决这个问题,我需要设置 v-list max-height: 100% 但这不起作用,因为 v-content 会增长以适应其中的内容。如何将v-content max height 设置为初始页面高度(具有适当的填充),并且当内容在其中时不增长或缩小?
<v-content class="main-content">
<router-view/>
</v-content>
<v-container pa-0 fluid fill-height>
<v-layout column>
<v-toolbar height="40px" color="white" flat>
<v-btn to="/gitremote" depressed color="#00b259" class="white--text" small>Open</v-btn>
</v-toolbar>
<v-toolbar height="33px" color="white" flat>
<v-breadcrumbs :items="breadcrumbs" divider="/"></v-breadcrumbs>
</v-toolbar>
<v-layout row>
<v-flex xs2>
<v-card color="white" height="100%">
<v-list two-line>
<v-list-tile v-for="listitem in currentDirectoryItems" :key="listitem" avatar
@click="navigateTo(listitem.itemType, listitem.itemId, listitem.name)">
<v-list-tile-avatar>
<v-icon>{{listitem.icon}}</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{listitem}}</v-list-tile-title>
<v-list-tile-sub-title>{{listitem.subtitle}}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<!-- <CommandMenu
v-bind:listItem="listitem"
v-bind:commandsObject="gitRepoItemCommands"
/> -->
</v-list-tile-action>
</v-list-tile>
</v-list>
</v-card>
</v-flex>
<v-flex>
<v-card>
EDITOR!!!!1
</v-card>
</v-flex>
</v-layout>
</v-layout>
</v-container>
【问题讨论】:
-
如果将属性
max-height: 100vh添加到“.main-content”类会发生什么 -
它不起作用,我添加了
overflow-y: auto,这似乎是正确的方向,但我对v-footer有一些剪裁问题。v-content没有为v-footer添加适量的填充