vue.js - Vuetify:在 v-autocomplete 中指定列表项的高度
问题描述
我正在使用v-autocomplete
带有自定义插槽的 a来显示结果:
<v-autocomplete :items=searchResults :loading=loading :search-input.sync="query" hide-no-data label="Entreprise, SIREN..." append-icon="search" v-model="selected" three-line >
<template v-slot:item="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.text"></v-list-tile-title>
<v-list-tile-sub-title v-text="item.value"></v-list-tile-sub-title>
>
<v-list-tile-sub-title> Third line of list item</v-list-tile-sub-title>
</v-list-tile-content>
<CompanyListItem :company=item :loading=false />
</template>
</v-autocomplete>
不幸的是,生成的列表项看起来是垂直压缩的,如codepen 所示。
是否可以在基础列表中添加two-line
或添加three-line
“更高”的列表项?将这些属性添加到<v-autocomplete>
不起作用。
解决方案
将列表图块的高度更改为自动,因为 CSS 属性对我有用。
.v-autocomplete__content .v-list__tile{
height: auto;
}
两行或三行<v-list></v-list>
是增加列表平铺高度的道具。但这里v-slot:item的内容默认包含在<v-list></v-list>
(当我在浏览器检查器中检查元素时)。
推荐阅读
- c++ - constexpr 构造函数需要常量成员函数的问题
- python - 使用 if 语句来了解用户是否创建了帖子
- c++ - 令牌“,”之前的预期主表达式
- html - HTML/CSS ; 我如何制作这个导航栏(水蓝色的?左边是 .png 格式的标志,它是如何突出背景的?
- python - 将单元格的每个单词转换为新行
- javascript - 如何在0和1的矩阵中找到两个随机点之间的路径
- python - 绘制水平条形图,给出意想不到的结果
- r - 将 blogdown 与 github 操作一起使用 - 替代 serve_site
- graphql - GraphQL 允许使用可为空条目定义数组的技术原因是什么?
- for-loop - 使用具有 2 个参数的机器人框架进行循环