el-table cell换行小技巧

冷夜洛
2023-12-01
<el-table-column
      align="center"
      label="描述"
     min-width="15%">
     <template slot-scope="scope">
        <span v-html="scope.row.message"  size="small"></span>
      </template>
     
    </el-table-column>

采用上面这种v-html的方式可以识别返回字段内的换行符
信息框内识别换行符

this.$alert(val, label, {
        dangerouslyUseHTMLString: true,//关键设置
        confirmButtonText: "确定",
        showConfirmButton: false,
        lockScroll: true,
        callback: (action) => {},
      });
 类似资料: