Browse Source

缺失title补全

yangc 8 years ago
parent
commit
337a663c91
1 changed files with 12 additions and 2 deletions
  1. 12 2
      components/product/component/ComponentDetail.vue

+ 12 - 2
components/product/component/ComponentDetail.vue

@@ -68,8 +68,8 @@
         </p>
         <ul v-if="list.properties && (list.properties.length > 1 || (list.properties.length == 1 && list.properties[0].value))">
           <li v-for="prop in properties">
-            <span :title="prop.property.labelCn">{{prop.property.labelCn || '-'}}</span>
-            <span :title="prop.value">{{prop.value || '-'}}</span>
+            <span :title="switchParams(prop.property.labelCn, 0)">{{prop.property.labelCn || '-'}}</span>
+            <span :title="switchParams(prop.value, 0)">{{prop.value || '-'}}</span>
           </li>
           <li v-if="!isEven(properties.length)">
             <span>-</span>
@@ -192,6 +192,16 @@
         } else {
           window.open(url)
         }
+      },
+      switchParams: function (str, index) {
+        let tmp = ''
+        if (str.length > index + 25) {
+          tmp += str.substring(index, index + 25)
+          tmp += '&#10;' + this.switchParams(str, index + 25)
+        } else {
+          tmp += str
+        }
+        return tmp
       }
     }
   }