解决方案如果是注释的路径无法显示,可以通过拿到文件的沙箱路径,通过调用@ohos.file.fileuri模块的fileuri.getUriFromPath(file.path)将沙箱路径转化为沙箱uri,传入之后即可正常显示沙箱图片,this.uri = fileUri.getUriFromPath(path); Image(this.uri)参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-file-fileuri-V5\#fileurigeturifrompath
解决方案
如果是注释的路径无法显示,可以通过拿到文件的沙箱路径,通过调用@ohos.file.fileuri模块的fileuri.getUriFromPath(file.path)将沙箱路径转化为沙箱uri,传入之后即可正常显示沙箱图片,
参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-file-fileuri-V5\#fileurigeturifrompath