<template slot="reason" slot-scope="text" > <div class="reasonText" :title="(text+'').replace(/<br \/>/g, '\r\n')" // title只識別\r\n換行 v-html="text" /> </template>
// 表格的Columns
{ title: '原因', dataIndex: 'reason', ellipsis: true, scopedSlots: { customRender: 'reason' }, width: '500px' }
// 超過4行顯示省略號
.reasonText{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }