refactor: 使用三元表达式来选择头像的 source

This commit is contained in:
ChaXxl 2024-08-11 14:02:32 +08:00
parent b723cfec4e
commit 4a457e15fa

View File

@ -315,12 +315,7 @@ FluContentPage{
radius: [20,20,20,20]
Image{
anchors.fill: parent
source: {
if(options && options.avatar){
return options.avatar
}
return ""
}
source: options && options.avatar ? options.avatar : ""
sourceSize: Qt.size(80,80)
}
}