Skip to content

Commit 4a2efc2

Browse files
committed
merge master
2 parents 725c94a + 96d3cfa commit 4a2efc2

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
## 简介
3232

33-
[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue)[element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
33+
[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue)[element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
3434

3535
- [在线预览](http://panjiachen.github.io/vue-element-admin)
3636

mock/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function mockXHR() {
1111
Mock.XHR.prototype.send = function() {
1212
if (this.custom.xhr) {
1313
this.custom.xhr.withCredentials = this.withCredentials || false
14+
this.custom.xhr.responseType = this.responseType
1415
}
1516
this.proxy_send(...arguments)
1617
}

src/views/login/index.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<svg-icon icon-class="user" />
1515
</span>
1616
<el-input
17+
ref="username"
1718
v-model="loginForm.username"
1819
:placeholder="$t('login.username')"
1920
name="username"
@@ -28,6 +29,7 @@
2829
</span>
2930
<el-input
3031
:key="passwordType"
32+
ref="password"
3133
v-model="loginForm.password"
3234
:type="passwordType"
3335
:placeholder="$t('login.password')"
@@ -98,7 +100,7 @@ export default {
98100
return {
99101
loginForm: {
100102
username: 'admin',
101-
password: '1111111'
103+
password: '111111'
102104
},
103105
loginRules: {
104106
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
@@ -121,6 +123,13 @@ export default {
121123
created() {
122124
// window.addEventListener('storage', this.afterQRScan)
123125
},
126+
mounted() {
127+
if (this.loginForm.username === '') {
128+
this.$refs.username.focus()
129+
} else if (this.loginForm.password === '') {
130+
this.$refs.password.focus()
131+
}
132+
},
124133
destroyed() {
125134
// window.removeEventListener('storage', this.afterQRScan)
126135
},
@@ -131,6 +140,9 @@ export default {
131140
} else {
132141
this.passwordType = 'password'
133142
}
143+
this.$nextTick(() => {
144+
this.$refs.password.focus()
145+
})
134146
},
135147
handleLogin() {
136148
this.$refs.loginForm.validate(valid => {

0 commit comments

Comments
 (0)