laf icon indicating copy to clipboard operation
laf copied to clipboard

在云函数上使用 string.matchAll ts会无法识别

Open yenche123 opened this issue 2 years ago • 4 comments

需要使用正则,所以用到了 matchAll,但遇到下图的情况 image 显示如下报错信息: Property 'matchAll' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.(2550)

yenche123 avatar Aug 06 '22 14:08 yenche123

在飘红处的前一行添加 //@ts-ignore 可以解决,并且能顺利运行

yenche123 avatar Aug 06 '22 14:08 yenche123

html 是 string 类型是吗?

maslow avatar Aug 07 '22 08:08 maslow

@maslow 对的

yenche123 avatar Aug 08 '22 03:08 yenche123

问题不大,有空再处理就好,优先级不高

yenche123 avatar Aug 08 '22 03:08 yenche123