新增Task任务报错10200006样例

Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
zgf 2024-08-28 17:00:43 +08:00
parent ddbff75a7d
commit 0c8a777c82
2 changed files with 8 additions and 6 deletions

View File

@ -36,6 +36,11 @@ struct Index {
uri: 'pages/TestCommonImage',
});
})
Button("测试占位图Task报错").margin({top:10}).onClick(()=>{
router.push({
uri: 'pages/TestTaskResourcePage',
});
})
Button("测试HSP场景预加载").margin({top:10}).onClick(()=>{
router.push({
uri: 'pages/TestHspPreLoadImage',

View File

@ -16,10 +16,9 @@ import { ImageKnifeComponent, ImageKnifeOption } from "@ohos/libraryimageknife"
@ComponentV2
export struct ZuImage {
@Param src: PixelMap | ResourceStr | string | undefined
@Param radius: BorderRadiuses | Length | LocalizedBorderRadiuses | undefined
@Param placeholderSrc: PixelMap | ResourceStr | string | undefined
@Param errorholderSrc: PixelMap | ResourceStr | string | undefined
@Param @Require src: PixelMap | ResourceStr | string | undefined
@Param @Require placeholderSrc: PixelMap | ResourceStr | string | undefined
@Local errorholderSrc: PixelMap | ResourceStr | string | undefined
build() {
if (this.src) {
@ -29,13 +28,11 @@ export struct ZuImage {
loadSrc: this.src,
placeholderSrc: this.placeholderSrc,
errorholderSrc: this.errorholderSrc ?? this.placeholderSrc,
border: { radius: this.radius },
objectFit: ImageFit.Cover
})
})
} else {
Image(this.placeholderSrc)
.border({ radius: this.radius })
.objectFit(ImageFit.Cover)
}
}