修复资源无法找到的问题

This commit is contained in:
2024-06-03 17:56:47 +08:00
parent 94812592c2
commit bab53c5e9f
5 changed files with 14 additions and 13 deletions

View File

@@ -26,7 +26,7 @@ export struct PhoneInput {
Row() {
Text(this.countryCode)
.height(44)
Image($r('app.media.ic_chevron_down'))
Image($r(`app.media.ic_chevron_down`))
.objectFit(ImageFit.Contain)
.width(12)
.height(12)
@@ -55,7 +55,7 @@ export struct PhoneInput {
})
.width('100%')
Image($r('app.media.ic_clear_circle'))
Image($r(`app.media.ic_clear_circle`))
.width(18)
.height(18)
.backgroundColor(Color.Green)

View File

@@ -25,11 +25,11 @@ export struct TitleBar {
@Prop menuPadding: number = 8;
@Prop leftText: ResourceStr = "";
@Prop leftIcon: Resource = $r("app.media.ic_chevron_left");
@Prop leftIcon: Resource = $r(`app.media.ic_chevron_left`);
@Prop leftMenuType: TitleBarMenuType = TitleBarMenuType.Icon;
@Prop rightText: ResourceStr = "";
@Prop rightIcon: Resource = $r("app.media.ic_close");
@Prop rightIcon: Resource = $r(`app.media.ic_close`);
@Prop rightMenuType: TitleBarMenuType = TitleBarMenuType.None;
@Prop titleTextAlign: TextAlign = TextAlign.Start;

View File

@@ -7,27 +7,27 @@ export class CommonRes {
}
public static getIconRefresh(): Resource {
return $r("app.media.ic_refresh");
return $r(`app.media.ic_refresh`);
}
public static getIconChevronLeft(): Resource {
return $r("app.media.ic_chevron_left");
return $r(`app.media.ic_chevron_left`);
}
public static getIconChevronRight(): Resource {
return $r("app.media.ic_chevron_right");
return $r(`app.media.ic_chevron_right`);
}
public static getIconClose(): Resource {
return $r("app.media.ic_close");
return $r(`app.media.ic_close`);
}
public static getIconEyeOn(): Resource {
return $r("app.media.ic_eye_on");
return $r(`app.media.ic_eye_on`);
}
public static getIconEyeOff(): Resource {
return $r("app.media.ic_eye_off");
return $r(`app.media.ic_eye_off`);
}
public static getImage(resName: string): Resource {