add password prop handle

This commit is contained in:
王劲鹏 2021-05-31 11:36:49 +08:00 committed by osborn
parent 1291bb17b1
commit 9f721aa1c8
2 changed files with 13 additions and 0 deletions

View File

@ -89,6 +89,17 @@ TextField {
}
}
property var password: false
onPasswordChanged: {
if (password) {
this.echoMode = TextInput.Password
} else {
this.echoMode = TextInput.Normal
}
}
passwordCharacter: "•"
property var borderWidth: 0
onBorderWidthChanged: {
bg.border.width = borderWidth

View File

@ -46,6 +46,8 @@ void DoricInputNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
view->setProperty("maximumLength", prop.toInt());
} else if (name == "inputType") {
view->setProperty("inputType", prop.toInt());
} else if (name == "password") {
view->setProperty("password", prop.toBool());
} else {
DoricViewNode::blend(view, name, prop);
}