Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chrome91版本,调用 editorService.update() 会出错,是否可以在下个版本兼容一下 #606

Open
li-quan-wang opened this issue May 16, 2024 · 4 comments

Comments

@li-quan-wang
Copy link

li-quan-wang commented May 16, 2024

浏览器版本:chrome91

问题:调用 editorService.update() 会出错,因为 Object.hasOwn 方法在该版本不支持,是否可以做下兼容

截图如下:
image
image

@li-quan-wang li-quan-wang changed the title 低版本浏览器报错,是否可以兼容一下 chrome91版本,调用 editorService.update() 会出错,是否可以在下个版本兼容一下 May 20, 2024
@jia000
Copy link
Collaborator

jia000 commented May 21, 2024

可以尝试一下使用legacy插件来提高兼容性

import legacy from '@vitejs/plugin-legacy';


 legacy({
    targets: ['chrome>=91'],
  }),

@li-quan-wang
Copy link
Author

我尝试过了,使用legacy插件应该只是提高自身项目的兼容性吧。而 doUpdate 方法在我使用的 @tmagic/editor 的包里,应该不起作用吧。

@jia000
Copy link
Collaborator

jia000 commented May 22, 2024

legacy 是加在你使用 @tmagic/editor的项目上的,怎么会不起作用

@jia000
Copy link
Collaborator

jia000 commented May 22, 2024

最简单的办法就是自己实现一下Object.hasOwn方法

https://github.com/zloirock/core-js中有对应的实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants