暴力處理 直接把/n 用.replace處里成<br/>
或是給white-space:break-spaces樣式
<el-table
:show-header="showHeader"
:data="tableData"
cell-style="white-space: break-spaces;"
style="width: 100%"
border
>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:prop="item.prop"
:label="item.label"
>
</el-table-column>
</el-table>
效果拔群 done
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:prop="item.prop"
:label="item.label"
>
<template slot-scope="scope">
<span v-html="scope ? scope.row[item.prop].replace(/\n/g, '<br />') : ''"></span>
</template>
</el-table-column>
全站熱搜