1、在el-descriptions中添加下面相关代码
<el-descriptions
:contentStyle="CS"
:label-style="LS"
direction="vertical"
:column="4"
border >
<el-descriptions-item label="xxx">{{
cuscasesDetail[0].name
}}</el-descriptions-item>
</el-descriptions>
2、在data的return中写入相关数据
CS: {
'text-align': 'center', //文本居中
width: '25%',
'word-break': 'break-all' //过长时自动换行
},
LS: {
// color: '#000',文字的颜色
'text-align': 'center',
height: '40px'
},
本文介绍了如何在Vue项目中使用Element-UI的el-descriptions组件,包括设置内容样式(如居中和自动换行)和定义label-style的样式,以及如何将数据绑定到描述项上。
4216

被折叠的 条评论
为什么被折叠?



