Showing
1 changed file
with
18 additions
and
16 deletions
| @@ -31,24 +31,26 @@ export struct SearchHotsComponent{ | @@ -31,24 +31,26 @@ export struct SearchHotsComponent{ | ||
| 31 | 31 | ||
| 32 | build(){ | 32 | build(){ |
| 33 | Column(){ | 33 | Column(){ |
| 34 | - Row() { | ||
| 35 | - Image($r('app.media.search_hot_icon')) | ||
| 36 | - .width('46lpx') | ||
| 37 | - .height('46lpx') | ||
| 38 | - .objectFit(ImageFit.Auto) | ||
| 39 | - .margin({right:'8lpx'}) | ||
| 40 | - .interpolation(ImageInterpolation.Medium) | 34 | + if(this.searchHotsData.length>0){ |
| 35 | + Row() { | ||
| 36 | + Image($r('app.media.search_hot_icon')) | ||
| 37 | + .width('46lpx') | ||
| 38 | + .height('46lpx') | ||
| 39 | + .objectFit(ImageFit.Auto) | ||
| 40 | + .margin({right:'8lpx'}) | ||
| 41 | + .interpolation(ImageInterpolation.Medium) | ||
| 41 | 42 | ||
| 42 | - Text("热门搜索") | ||
| 43 | - .textAlign(TextAlign.Center) | ||
| 44 | - .fontWeight(FontWeight.Bold) | ||
| 45 | - .fontSize('33lpx') | ||
| 46 | - .lineHeight('46lpx') | ||
| 47 | - .fontColor($r('app.color.color_222222')) | ||
| 48 | - .height('46lpx') | 43 | + Text("热门搜索") |
| 44 | + .textAlign(TextAlign.Center) | ||
| 45 | + .fontWeight(FontWeight.Bold) | ||
| 46 | + .fontSize('33lpx') | ||
| 47 | + .lineHeight('46lpx') | ||
| 48 | + .fontColor($r('app.color.color_222222')) | ||
| 49 | + .height('46lpx') | ||
| 50 | + } | ||
| 51 | + .width('100%') | ||
| 52 | + .margin({bottom:"15lpx"}) | ||
| 49 | } | 53 | } |
| 50 | - .width('100%') | ||
| 51 | - .margin({bottom:"15lpx"}) | ||
| 52 | 54 | ||
| 53 | List(){ | 55 | List(){ |
| 54 | ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ | 56 | ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ |
-
Please register or login to post a comment