xiongchao 3 years ago
parent
commit
a49465f072
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/views/test/BaseFormBak.vue

+ 3 - 0
src/views/test/BaseFormBak.vue

@@ -368,6 +368,8 @@ export default {
     this.data = JSON.parse(localStorage.getItem('test'))
     if (this.data != null) {
       this.index = this.data.length + 1
+    } else {
+      this.data = []
     }
   },
   methods: {
@@ -393,6 +395,7 @@ export default {
         this.$message.info('更新成功')
         this.confirmLoading = false
         localStorage.setItem('test', JSON.stringify(this.data))
+        this.form.resetFields()
       })
     },
     handleCancel (values) {