We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
v2.40.0新引入的高亮组件Highlight,如果参数patterns传入的数组中含有长度为0的字符串,则会正则匹配卡住(疯狂消耗CPU),导致页面无响应
v2.40.0
patterns
这时候就得手动array.filter(Boolean)过滤掉了,有点麻烦。这块地方应该组件内处理一下吧,如果发现空串就是不进行高亮操作,直接忽略。
访问复现链接,将Demo.vue文件中patterns数组中任意一个长度不为0的字符串修改为长度为0的字符串,程序卡住无响应
https://codesandbox.io/p/sandbox/8pjg29
System: OS: Windows 10 10.0.19043 CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics Memory: 7.32 GB / 15.86 GB Binaries: Node: 20.15.0 - D:\nodejs\node.EXE npm: 10.8.3 - D:\nodejs\npm.CMD pnpm: 9.10.0 - ~\AppData\Local\pnpm\pnpm.CMD Browsers: Edge: Spartan (44.19041.1266.0), Chromium (127.0.2651.74) Internet Explorer: 11.0.19041.1566 npmPackages: naive-ui: ^2.40.1 => 2.40.1 vue: ^3.5.10 => 3.5.10
pnpm
The text was updated successfully, but these errors were encountered:
No branches or pull requests
描述错误
v2.40.0
新引入的高亮组件Highlight,如果参数patterns
传入的数组中含有长度为0的字符串,则会正则匹配卡住(疯狂消耗CPU),导致页面无响应这时候就得手动array.filter(Boolean)过滤掉了,有点麻烦。这块地方应该组件内处理一下吧,如果发现空串就是不进行高亮操作,直接忽略。
复现步骤
访问复现链接,将Demo.vue文件中patterns数组中任意一个长度不为0的字符串修改为长度为0的字符串,程序卡住无响应
最小复现链接
https://codesandbox.io/p/sandbox/8pjg29
系统信息
使用的包管理器
pnpm
验证
The text was updated successfully, but these errors were encountered: