登录页面改造
This commit is contained in:
@@ -11,9 +11,23 @@ Tea.context(function () {
|
||||
|
||||
this.isSubmitting = false
|
||||
|
||||
this.refreshPlaceholders = function () {
|
||||
let usernameInput = document.querySelector("form input[name='username']")
|
||||
if (usernameInput != null) {
|
||||
usernameInput.setAttribute("placeholder", "\u8bf7\u8f93\u5165\u8d26\u53f7")
|
||||
}
|
||||
let passwordInput = document.querySelector("form input[type='password']")
|
||||
if (passwordInput != null) {
|
||||
passwordInput.setAttribute("placeholder", "\u8bf7\u8f93\u5165\u5bc6\u7801")
|
||||
}
|
||||
}
|
||||
|
||||
this.$delay(function () {
|
||||
this.$find("form input[name='username']").focus()
|
||||
this.changePassword()
|
||||
this.refreshPlaceholders()
|
||||
// Some UI scripts mutate placeholders after mount; enforce once more.
|
||||
setTimeout(() => this.refreshPlaceholders(), 200)
|
||||
});
|
||||
|
||||
this.changeUsername = function () {
|
||||
@@ -56,4 +70,4 @@ Tea.context(function () {
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user