原因: html 识别不了 '\n',所以不起换行的效果
Data:
this.tableData:[
{ "description": "指定支付方式。\n格式为数组字符串:\n no_credit:指定不能使用信用卡支付。\n no_balance:指定不能使用零钱支付。\n no_debit:指定不能使用储蓄卡支付。\n balance_only:指定只能使用零钱支付。", "fieldName": "limit_pay", "fieldType": "String", "require": true, "requireYesOrNo": "Y" },]
效果 :
识别不了'\n'
参考方案:
在结果所在的 div 的 css 设置:
/** white-space: pre-line; **/
.doc_table {
white-space: pre-line;
width: 100%;
margin-top: 10px;
border: 2px solid #cbe7fd;
}