后台java代码,加上n
换行符
StringBuffer stb= new StringBuffer();
stb.append("测试消息").append("n");
TestModel t = new TestModel();
t.setMsg(stb.toString());
html还是照旧写:
代码语言:javascript复制 <el-table
:data="handleInfo"
:header-cell-style="headClass"
height="350px"
border>
<el-table-column
label="序号"
width="60"
align="center">
<template slot-scope="scope">{{scope.$index 1}}</template>
</el-table-column>
<el-table-column
prop="stepName"
label="环节名称"
align="center"
width="150">
</el-table-column>
<el-table-column
prop="msg"
label="办理意见">
</el-table-column>
</el-table>
关键在css文件添加:
代码语言:javascript复制.el-table .cell {
white-space: pre-line;
}