diff --git a/advanced_ui_component_static/composeListItem/@ohos.arkui.advanced.ComposeListItem.ets b/advanced_ui_component_static/composeListItem/@ohos.arkui.advanced.ComposeListItem.ets index bd0059f387a4fea83d696e1c74166d4c4aeba45e..67428ca6ed38a4eb75abd2ae17c24efe45c77a21 100644 --- a/advanced_ui_component_static/composeListItem/@ohos.arkui.advanced.ComposeListItem.ets +++ b/advanced_ui_component_static/composeListItem/@ohos.arkui.advanced.ComposeListItem.ets @@ -170,7 +170,7 @@ const OPERATE_ITEM_RADIUS: number = 50; const DEFUALT_RADIO_CHECKBOX_BORDER_COLOR: ResourceColor = $r('sys.color.ohos_id_color_switch_outline_off'); const TEXT_SUPPORT_MARQUEE: number = 1; const IS_MARQUEE_OR_ELLIPSIS: number = - LengthMetrics.resource($r('sys.float.composeListItem_right_textOverflow')).value as number; + LengthMetrics.resource($r('sys.float.composeListItem_right_textOverflow')).value.toDouble(); const UNUSUAL: number = -1; const FOCUSED_BG_COLOR: ResourceColor = $r('sys.color.composeListItem_container_focus_color'); const NORMAL_BG_COLOR: ResourceColor = $r('sys.color.composeListItem_container_normal_color'); @@ -1184,7 +1184,7 @@ export struct ComposeListItem { @State canTouch: boolean = true; @State canHover: boolean = true; @State isHover: boolean = false; - @State itemHeight: number = ItemHeight.FIRST_HEIGHT as number; + @State itemHeight: number = ItemHeight.FIRST_HEIGHT; @State isActive: boolean = false; @State hoveringColor: ResourceColor = '#0d000000'; @State touchDownColor: ResourceColor = '#1a000000'; @@ -1236,10 +1236,10 @@ export struct ComposeListItem { this.itemHeight = ItemHeight.FIRST_HEIGHT; } else { const systemIconLineHeight = - LengthMetrics.resource($r('sys.float.composeListItem_system_icon_line_height')).value as number; + LengthMetrics.resource($r('sys.float.composeListItem_system_icon_line_height')).value.toDouble(); this.itemHeight = - (this.contentItem?.iconStyle as IconType) <= IconType.HEAD_SCULPTURE ? ItemHeight.SECOND_HEIGHT as number : - systemIconLineHeight as number; + (this.contentItem?.iconStyle as IconType) <= IconType.HEAD_SCULPTURE ? ItemHeight.SECOND_HEIGHT : + systemIconLineHeight.toDouble(); } } else if (this.contentItem?.description === undefined) { let iconStyle: IconType = (this.contentItem?.iconStyle as IconType); @@ -1630,4 +1630,4 @@ export struct ComposeListItem { y: IS_SUPPORT_SUBCOMPONENT_EVENT ? undefined : RECOVER_ITEM_SCALE }; } -} \ No newline at end of file +}