From 64e19a2f3a9c35442dec29139626b5cba607418d Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Fri, 4 Aug 2023 14:32:34 +0800 Subject: [PATCH] setfoucs --- src/views/basic-dictionary/BirthPlace.vue | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/views/basic-dictionary/BirthPlace.vue b/src/views/basic-dictionary/BirthPlace.vue index 54d3467..dbacd29 100644 --- a/src/views/basic-dictionary/BirthPlace.vue +++ b/src/views/basic-dictionary/BirthPlace.vue @@ -94,7 +94,7 @@ > - { @@ -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];