<p
class="aa"
v-html="transChar(topicInfo.value, '\n', '<br>')"
></p>
/**
* 查看页面字段换行问题
*/
transChar (val, patten, replaceChar) {
if (!val) {
return ''
}
let reg = new RegExp(patten, 'g')
return val.replace(reg, replaceChar)
},
<p
class="aa"
v-html="transChar(topicInfo.value, '\n', '<br>')"
></p>
/**
* 查看页面字段换行问题
*/
transChar (val, patten, replaceChar) {
if (!val) {
return ''
}
let reg = new RegExp(patten, 'g')
return val.replace(reg, replaceChar)
},