HarmonyOS 容器类的组件设置了margin,如何实现当内容为空时margin不生效

HarmonyOS
2024-12-25 14:27:16
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
fox280

示例参考如下:

@State content: boolean = true
...
row(){
  ...
}
.margin({top:this.content==true?'10vp':'0'})
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
分享
微博
QQ
微信
回复
2024-12-25 16:48:38


相关问题
HarmonyOS margin生效
1431浏览 • 1回复 待解决
HarmonyOS margin生效问题
1041浏览 • 1回复 待解决
HarmonyOS 宽度100% margin左右生效
1087浏览 • 1回复 待解决
HarmonyOS rightpadding和margin生效
1562浏览 • 1回复 待解决
HarmonyOS 设置margin无效
558浏览 • 1回复 待解决
容器组件onVisibleAreaChange生效
2753浏览 • 1回复 待解决