首页 > 技术文章 > ant-design-vue——a-select下拉框值为空字串时,高度偏窄问题

linjiangxian 2020-08-18 14:48 原文

问题页面(红框处即为值为空字符串的数据):

 

 

改后:

 

 

页面:

···
<a-select v-model="formData.urgentLevel" style="width: 100%" dropdownClassName="selectOption"> <a-select-option v-for="(item,index) in URGENTLEVEL" :key="index" :value="item.code">{{item.name}}</a-select-option> </a-select> ··· URGENTLEVEL:[{ code:'01', name:' ' },{ code:'02', name:'平急' }]
···

 

关键——css:

.ant-select-dropdown-menu-item {  //写在全局处
  height: 30px;
}

 

推荐阅读