angular - 剑道下拉列表弹出高度不起作用
问题描述
在这个StackBlitz 中,我有一个 Kendo for Angular 下拉列表,其弹出高度设置为 20px。尽管如此,当我打开下拉列表时,弹出高度保持不变。如何使这项工作?
@Component({
selector: 'my-app',
template: `
<kendo-dropdownlist [data]="listItems" [popupSettings]="{ height: 20 }">
</kendo-dropdownlist>
`
})
export class AppComponent {
public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
}
解决方案
更好的方法是使用 popupClass 而不是 height。这使您能够定义为弹出窗口执行的 css 类。在该类中,您可以定义 min-height 等属性。
[popupSettings]="{ popupClass: 'myPopupClass' }"
编辑:
在上述解决方案中,您似乎必须设置 ViewEncapsulation.None 并在 css 中设置 height 属性。
我找到了一个更简单的解决方案:
看起来你还必须设置' listHeight '。默认情况下,listHeight 为 200 像素。
看看这个Stackblitz
<kendo-dropdownlist [data]="listItems" [popupSettings]="{ height: 20 }" listHeight="20">
</kendo-dropdownlist>
推荐阅读
- sql - 如何在组中查找缺失的行?
- python - 为 Python 程序计时
- flutter - 键盘粉碎文本字段
- python - 使用 CNN 超参数优化进行多目标回归时出错
- python - 在jupyter笔记本中使用ipyleaflet,地图对象显示文本字符串而不是地图
- reactjs - 在哪里或如何将 Laravel 护照中的访问令牌存储在反应中
- google-cloud-platform - 为什么我在尝试设置 Google 安全浏览数据库时收到“未找到 sbserver”错误?
- web - 闪电格式化日期时间 - 显示上一个日期 (LWC)
- elasticsearch - 使用 NestJS/Elastic 对服务进行单元测试的正确方法是什么
- c++ - C++ 中的并行向量/数组比较