解决elmentui Descriptions的label竖向显示
1.问题描述
就突然看之前写的代码,用了elmentui的Descriptions组件,发现它的label竟然竖着展示了,原因我是没找出来的。。。
肯定是不能展示的嘛,解决它!!!
最后也是能解决问题的
2.解决问题
2.1 没用slot(插槽)
//css
.describle {
margin: 24px 0;
.el-descriptions-item__label {
font-size: 13px;
line-height: 23px;
font-weight: 700;
color: #515a6e;
width: 40px;
white-space: nowrap;
}
}
主要就是找到自己模块下的label,设置一个样式white-space: nowrap!!!这是重点
2.2 用了slot(插槽)
<el-descriptions-item :key="index">
<template slot="label">
<span class="desSpan" style="white-space:nowrap;">{{ item.WJJGMC }}</span>
</template>{{
item.WBNR || "/"
}}</el-descriptions-item>
用了插槽的更简单,要么直接内联样式,要么就给个class名在style写上样式,记住,white-space:nowrap!!!