【发布时间】:2020-02-01 09:20:31
【问题描述】:
My vue page have a photo gallery, and when a photo is selected, the dialog will jump out by setting the selectedCard.
虽然图像不适合屏幕大小。
我尝试将 css 设置为 100% 的最大高度或宽度,但它们都不起作用。
如何修复我的 css 以便可以在屏幕上查看整个图像而无需滚动?
屏幕截图:只能显示一半的图像
//Dialog component
<template>
<v-dialog :value="selectedCard" scrollable fullscreen hide-overlay>
<v-card v-if="selectedCard">
<v-container grid-list-sm fluid>
<v-layout align-space-around row fill-height>
<v-flex id="mainCardPanel">
<v-layout align-space-around column fill-height>
<v-flex xs12>
<MyCard class="mainCard" :card="selectedCard"></MyCard>
</v-flex>
<v-flex xs12>
<v-btn> SomeButton </v-btn>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-container>
</v-card>
</v-dialog>
</template>
// MyCard component
<template>
<v-card flat tile class="d-flex justify-center" >
<v-img :contain="true" :src=card.imageUrlHiRes
:lazy-src=card.imageUrl class="grey lighten-2 Card">
<template v-slot:placeholder>
<v-layout fill-height align-center justify-center ma-0>
<v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular>
</v-layout>
</template>
</v-img>
</v-card>
</template>
【问题讨论】:
-
在此处分享您的工作代码https://codesandbox.io/s/vue
-
请也分享您的 CSS 代码,否则几乎无法帮助您。