Oh3.2项目升级到Oh5.0(鸿蒙Next)具体踩坑记录二

接着上一篇:Oh3.2项目升级到Oh5.0(鸿蒙Next)具体踩坑记录(一)-CSDN博客

然后继续记录踩坑,如下开始是代码中报错,主要是3.2中的一些api在5.0中不支持,所以要进行修改

1.Using "this" inside stand-alone functions is not supported (arkts-no-standalone-this)

上述的意思是this不能再内部使用,需要放在外面,如下:

2. Use explicit types instead of "any", "unknown" (arkts-no-any-unknown)

上述是不知道err的类型,修改如下: