在mdAutocomplete上下拉箭头(如mdSelect拥有) [英] Drop down arrow on mdAutocomplete (like mdSelect has)
问题描述
有没有办法像md-select一样在md-autocomplete上获得下拉箭头?
Is there a way to get a drop down arrow on md-autocomplete like md-select has?
它提供了直观的提示,表明控件具有下拉菜单,并且允许用户无需输入任何内容即可打开下拉菜单
It provided a visual clue that the control has a drop down, AND allows the user to open the drop down without typing anything
推荐答案
Angular Material不提供此类功能,但是您可以尝试在CSS文件中添加如下内容:
Angular Material does not provide such functionality but you could try to add something like this in your css file:
md-autocomplete-wrap:after {
display: block;
content: '\25BC';
position: relative;
top: 5px;
speak: none;
font-size: 13px;
left: -10px;
color: rgba(0,0,0,0.38);
-webkit-transform: scaleY(.5) scaleX(1);
transform: scaleY(.5) scaleX(1);
}
这不是完美的解决方案,但对您来说可能就足够了.
Its not perfect solution, but may be enough for you.
如果要在单击时打开下拉菜单,只需将md-min-length ="0"属性添加到md-autocomplete.
And if you want to make dropdown open on click, just add md-min-length="0" attribute to your md-autocomplete.
这篇关于在mdAutocomplete上下拉箭头(如mdSelect拥有)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!