replace to replaceAll

This commit is contained in:
liangping 2022-04-23 22:19:47 +08:00
parent 7cf7ae9a1e
commit 4fbaec7fbb

View File

@ -159,11 +159,7 @@ export default {
if (percentage.test(value)) {
return `${percent(value)}%`
}
if (typeof value === 'string') {
return value.replaceAll('\\n', '\n')
}
return value
return value.replace(/(?:\\[rn])+/g, '\n')
},
},
}