Browse Source

【器件选型】

ouxq 8 years ago
parent
commit
1ed11200b8
1 changed files with 21 additions and 2 deletions
  1. 21 2
      components/product/CategoryProperty.vue

+ 21 - 2
components/product/CategoryProperty.vue

@@ -47,7 +47,7 @@
         <table class="table table-bordered" style="table-layout:fixed;">
           <thead>
           <tr>
-            <td v-for="pro in properties" class="td-width word-break" split-dropdown-trigger="pro.id">
+            <td v-for="pro in properties" class="list-menu td-width word-break" split-dropdown-trigger="pro.id" v-on:mouseenter="triggerOnMouseEnter(pro.id)">
               <span class="dropdown-toggle dropdown-back" data-toggle="dropdown"><span>{{pro.property.labelCn}}</span><span class="fa fa-angle-down td-icon"></span></span>
             </td>
           </tr>
@@ -70,7 +70,7 @@
         </table>
       </div>
       <div>
-        <div v-for="pro in properties" split-dropdown-toggle="pro.id" style="top: 40px !important">
+        <div v-for="pro in properties" split-dropdown-toggle="pro.id" class="x-split-dropdown-toggle" style="top: 40px !important;display: block">
           <ul class="parameter-selection-ul drop-down-list" role="menu" aria-labelledby="dropdownMenu1">
             <!--|orderBy:'value'-->
             <li v-for="v in pro.values"><a @click="selectPropertyValue(pro, value)" class="a-color"><span>{{v.value}}</span></a></li>
@@ -92,6 +92,14 @@
         }
       }
     },
+    mounted () {
+//      var list = document.getElementsByClassName('list-menu')
+//      var container = document.getElementsByClassName('div-table')
+//      list.onmouseover = function () {
+//        var id = list[0].getAttribute['split-dropdown-trigger']
+//        console.log(id)
+//      }
+    },
     computed: {
       kind () {
         return this.$store.state.product.kind.kindsParentWithBother.data[this.$store.state.product.kind.kindsParentWithBother.data.length - 1]
@@ -107,6 +115,17 @@
       }
     },
     methods: {
+      triggerOnMouseEnter (id) {
+        console.log(id)
+        let toggles = document.getElementsByClassName('x-split-dropdown-toggle')
+        for (let i in toggles) {
+          console.log(toggles[i])
+          let toggleId = toggles[i].getAttribute('split-dropdown-toggle')
+          if (toggleId === id) {
+            console.log(toggles[i])
+          }
+        }
+      },
       selectBrand (item) {
         return null
       },