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)) { if (percentage.test(value)) {
return `${percent(value)}%` return `${percent(value)}%`
} }
if (typeof value === 'string') { return value.replace(/(?:\\[rn])+/g, '\n')
return value.replaceAll('\\n', '\n')
}
return value
}, },
}, },
} }