使用univer4.0.2版本遇到几个奇怪的问题请教下各位 #4040
Unanswered
hello-yajing
asked this question in
Q&A | 常见问题
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
问题一:拿到的字符串中包含换行符\n,我将 \n替换为\r并在字符串结尾追加\r\n后赋值给单元格内容。然后从单元格复制粘贴这个内容,两行中间会多出一行空白行。
`
let sql = 'select *
from test';
// 设置单元格富文本内容:
cellData.p = {
body: {
dataStream: sql.replace(/\n/g, '\r') + '\r\n'
}
}
// 复制粘贴后,期望粘贴的结果:
select *
from test
// 复制粘贴后,实际粘贴的结果:
select *
from test
`
问题二:单元格内包含<或>时,复制粘贴的内容会丢失,猜测是把内容当做html处理掉了。
以上两个问题,在我本地项目中是正常的。但是部署到公司测试环境后,就有问题。
因为已经投产使用急需解决这两个问题,请各位大佬指点一下~万分感谢!
Beta Was this translation helpful? Give feedback.
All reactions