forked from github/dataease
fix: 系统管理表单增加回车保存事件
This commit is contained in:
parent
a01c7f74ff
commit
2bead0a66e
@ -169,7 +169,25 @@ export default {
|
||||
}
|
||||
this.initRoles()
|
||||
},
|
||||
mounted() {
|
||||
this.bindKey()
|
||||
},
|
||||
destroyed() {
|
||||
this.unBindKey()
|
||||
},
|
||||
methods: {
|
||||
entryKey(event) {
|
||||
const keyCode = event.keyCode
|
||||
if (keyCode === 13) {
|
||||
this.save()
|
||||
}
|
||||
},
|
||||
bindKey() {
|
||||
document.addEventListener('keyup', this.entryKey)
|
||||
},
|
||||
unBindKey() {
|
||||
document.removeEventListener('keyup', this.entryKey)
|
||||
},
|
||||
repeatValidator(rule, value, callback) {
|
||||
if (value !== this.form.password) {
|
||||
callback(new Error(this.$t('member.inconsistent_passwords')))
|
||||
|
@ -143,6 +143,7 @@
|
||||
label-width="120px"
|
||||
:rules="rule"
|
||||
class="demo-ruleForm"
|
||||
@keyup.enter.native="editUserPassword('editPasswordForm')"
|
||||
>
|
||||
<el-form-item :label="$t('member.new_password')" prop="newPassword">
|
||||
<el-input v-model="ruleForm.newPassword" type="password" autocomplete="off" show-password />
|
||||
|
Loading…
Reference in New Issue
Block a user