【问题标题】:Vuetify - v-data-table break the height of a v-cardVuetify - v-data-table 打破 v-card 的高度
【发布时间】:2021-02-09 19:00:23
【问题描述】:

我使用 Vuetify 开发仪表板。我需要所有具有特定高度的卡片,在本例中为 450 像素。我从 axios 请愿书中填充 v-data-table,当 v-data-table 填充 whit 数据时,它打破了 v-card 的高度。

查看 v-card Tabla Tarificador carteras

这是我的 v-card 组件代码:

<v-row>
    <v-col cols="12" md="7">
        <v-card height="450">
            <v-card-text>
                <v-row>
                    <v-col cols="12">
                        <v-data-table
                            :fixed-header="true"
                            :headers="tablas.tarificadorCarteras.cabeceras"
                            :items="tablas.tarificadorCarteras.datos"
                        >
                            <template v-slot:[`item.cartera`]="{ item }">
                                <a @click="obtenerGraficoTarificadorCartera(item.cartera)" class="text-capitalize">{{ item.cartera }}</a> 
                            </template>
                            <template v-slot:[`item.minutos_entel`]="{ item }">
                                {{ new Intl.NumberFormat('es-CL').format(item.minutos_entel) }}
                            </template>
                            <template v-slot:[`item.minutos_movistar`]="{ item }">
                                {{ new Intl.NumberFormat('es-CL').format(item.minutos_movistar) }}
                            </template>
                            <template v-slot:[`item.minutos_pacifico`]="{ item }">
                                {{ new Intl.NumberFormat('es-CL').format(item.minutos_pacifico) }}
                            </template>
                        </v-data-table>
                    </v-col>
                </v-row>
            </v-card-text>
        </v-card>
    </v-col>
</v-row>

我需要查看 v-card 内的 v-data-table 可滚动和响应式。我试着做,但做不到

【问题讨论】:

    标签: vue.js vuejs2 vuetify.js


    【解决方案1】:

    max-height="450" style="overflow-y:auto" 设置为v-col

    【讨论】:

    • 我设置了选项,但是v-data-table还是打破了v-card高度ibb.co/KK4GV3k
    • 您是否从 v-card 中删除了 height="450"
    • 所以从标签到 v-data-table 尝试裸 css:style="overflow-y:auto;max-height:450px"。这应该可以解决您的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-11
    • 2020-02-26
    • 2019-11-10
    • 2020-12-13
    • 2019-11-19
    • 2022-06-18
    • 2021-02-11
    相关资源
    最近更新 更多