sys 3 éve
szülő
commit
51a40486df
1 módosított fájl, 6 hozzáadás és 29 törlés
  1. 6 29
      components/en-from/en-select/en-select.vue

+ 6 - 29
components/en-from/en-select/en-select.vue

@@ -21,30 +21,7 @@ export default {
   props: {
     localData: {
       type: Array,
-      default: [{
-        text: "一年级",
-        value: "1-0",
-        children: [{
-          text: "1.1班",
-          value: "1-1"
-        },
-          {
-            text: "1.2班",
-            value: "1-2"
-          }]
-      },
-        {
-          text: "二年级",
-          value: "2-0",
-          children: [{
-            text: "2.1班",
-            value: "2-1"
-          },
-            {
-              text: "2.2班",
-              value: "2-2"
-            }]
-        }]
+      default: []
     },
     label: {
       type: String,
@@ -73,7 +50,7 @@ export default {
   data() {
     return {
       inputValue: [],
-      optionName: '',
+      optionName: '23432432',
       labelWidth: 0,
       showPicker:false
     }
@@ -88,6 +65,7 @@ export default {
       this.setValue()
     },
     'inputValue': function () {
+      console.log(this.inputValue)
       if(this.valueType==='1'){
         this.$emit('input', this.inputValue.join(','))
       }else {
@@ -105,15 +83,15 @@ export default {
         this.inputValue=value
         this.optionName = "";
         this.localData.forEach((one)=>{
-          if(one.value===this.inputValue[0]){
+          if(one.value+''===this.inputValue[0]+''){
             this.optionName += one.text + " ";
             if(one.children){
               one.children.forEach((two)=>{
-                if(two.value===this.inputValue[1]){
+                if(two.value+''===this.inputValue[1]+''){
                   this.optionName += two.text + " ";
                   if(two.children){
                     two.children.forEach((three)=>{
-                      if(three.value===this.inputValue[2]){
+                      if(three.value+''===this.inputValue[2]+''){
                         this.optionName += three.text + " ";
                       }
                     })
@@ -130,7 +108,6 @@ export default {
       this.showPicker = false;
     },
     showPickerObj() {
-      console.log(this.$refs.pickerObj)
       this.$refs.pickerObj.show();
       this.showPicker = true;
     },