Browse Source

setfoucs

master
pengjun 2 years ago
parent
commit
64e19a2f3a
  1. 23
      src/views/basic-dictionary/BirthPlace.vue

23
src/views/basic-dictionary/BirthPlace.vue

@ -94,7 +94,7 @@
></el-col>
<el-col :span="7">
<el-form-item label="名称" prop="displayName">
<el-input
<el-input
ref="refinput"
v-model="form.displayName"
style="width: 100%"
@ -366,6 +366,7 @@ export default {
},
//
edit(row) {
this.resetFields()
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据");
@ -373,8 +374,11 @@ export default {
this.title = 2;
// this.form = row;
this.dialogVisible = true;
this.getFocus();
}
},
//
addoredit() {
this.$refs.form.validate((v) => {
@ -420,15 +424,26 @@ export default {
//
add() {
this.form = { ...this.curRow };
this.dialogVisible = true;
this.title = 1;
this.form = {};
this.resetFields();
this.getFocus();
},
getFocus(){
this.$nextTick(() => {
this.$refs.refinput.focus();
});
});
},
resetFields(){
this.$nextTick(() => {
this.$refs.form.resetFields();
});
},
//
getlist() {
nativeplacelist(this.pages).then((res) => {
this.initTableData = [...res.data.items];

Loading…
Cancel
Save