Browse Source

fix:解决打开时切换类型报错的问题

liuzl 2 years ago
parent
commit
e1f85a1cfa
1 changed files with 3 additions and 4 deletions
  1. 3 4
      components/SelectDealer.vue

+ 3 - 4
components/SelectDealer.vue

@@ -84,9 +84,6 @@
         return str
       },
     },
-    onHide() {
-      this.userList = []
-    },
     methods: {
       async getList() {
         this.loading = true
@@ -110,12 +107,14 @@
         }
       },
       open() {
+        this.userList = []
+        this.selected = null
         this.selectVisible = true
         this.getList()
       },
       close() {
-        this.selectVisible = false
         this.$emit('close', this.selected)
+        this.selectVisible = false
       },
       radioChange(n) {
         this.selected = this.userList.find((item) => item.id == n)