mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 23:16:53 +08:00
60 lines
1.2 KiB
QML
60 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Window
|
|
import QtQuick.Controls
|
|
import FluentUI
|
|
import "qrc:///example/qml/component"
|
|
|
|
FluScrollablePage{
|
|
|
|
title:"Captcha"
|
|
|
|
FluCaptcha{
|
|
id:captcha
|
|
Layout.topMargin: 20
|
|
ignoreCase:switch_case.checked
|
|
MouseArea{
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: {
|
|
captcha.refresh()
|
|
}
|
|
}
|
|
}
|
|
|
|
FluButton{
|
|
text:"Refresh"
|
|
Layout.topMargin: 20
|
|
onClicked: {
|
|
captcha.refresh()
|
|
}
|
|
}
|
|
|
|
FluToggleSwitch{
|
|
id:switch_case
|
|
text:"Ignore Case"
|
|
checked: true
|
|
Layout.topMargin: 10
|
|
}
|
|
|
|
RowLayout{
|
|
spacing: 10
|
|
Layout.topMargin: 10
|
|
FluTextBox{
|
|
id:text_box
|
|
placeholderText: "请输入验证码"
|
|
}
|
|
FluButton{
|
|
text:"verify"
|
|
onClicked: {
|
|
var success = captcha.verify(text_box.text)
|
|
if(success){
|
|
showSuccess("验证码正确")
|
|
}else{
|
|
showError("错误验证,请重新输入")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|