mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-06 17:49:50 +08:00
首次登陆获取焦点
This commit is contained in:
parent
6af0329f1e
commit
91a9935947
@ -13,6 +13,7 @@
|
|||||||
<svg-icon icon-class="user" />
|
<svg-icon icon-class="user" />
|
||||||
</span>
|
</span>
|
||||||
<el-input
|
<el-input
|
||||||
|
ref="usernameInput"
|
||||||
v-model="loginForm.username"
|
v-model="loginForm.username"
|
||||||
:placeholder="$t('login.username')"
|
:placeholder="$t('login.username')"
|
||||||
name="username"
|
name="username"
|
||||||
@ -26,6 +27,7 @@
|
|||||||
<svg-icon icon-class="password" />
|
<svg-icon icon-class="password" />
|
||||||
</span>
|
</span>
|
||||||
<el-input
|
<el-input
|
||||||
|
ref="passwordInput"
|
||||||
v-model="loginForm.password"
|
v-model="loginForm.password"
|
||||||
:type="passwordType"
|
:type="passwordType"
|
||||||
:placeholder="$t('login.password')"
|
:placeholder="$t('login.password')"
|
||||||
@ -119,6 +121,13 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
// window.addEventListener('hashchange', this.afterQRScan)
|
// window.addEventListener('hashchange', this.afterQRScan)
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.loginForm.username === '') {
|
||||||
|
this.$refs.usernameInput.focus()
|
||||||
|
} else if (this.loginForm.password === '') {
|
||||||
|
this.$refs.passwordInput.focus()
|
||||||
|
}
|
||||||
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
// window.removeEventListener('hashchange', this.afterQRScan)
|
// window.removeEventListener('hashchange', this.afterQRScan)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user