Browse Source

selectUnit回显的问题

cxmo 5 months ago
parent
commit
772b480c0f
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/components/selectUnit.vue

+ 8 - 4
src/components/selectUnit.vue

@@ -50,10 +50,14 @@ export default {
         }
         }
     },
     },
     watch:{
     watch:{
-        value(){
-            if(this.value){
-                this.unit = this.getUnitTrans(this.value)
-            }
+        value:{
+            handler(){
+                if(this.value){
+                    console.log('value',this.value)
+                    this.unit = this.getUnitTrans(this.value)
+                }
+            },
+            immediate:true
         }
         }
     },
     },
     data() {
     data() {