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] radius: [20,20,20,20]
Image{ Image{
anchors.fill: parent anchors.fill: parent
source: { source: options && options.avatar ? options.avatar : ""
if(options && options.avatar){
return options.avatar
}
return ""
}
sourceSize: Qt.size(80,80) sourceSize: Qt.size(80,80)
} }
} }