Procházet zdrojové kódy

装箱单成衣-详情-省略字符

jbb před 2 roky
rodič
revize
798c00c746

+ 11 - 1
src/views/packing-list/packinglist-clothes/detailsClothesDrawer.vue

@@ -34,7 +34,7 @@
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="英文品名" prop="englishProductName">
-                  {{clothesAdd.englishProductName}}
+                  {{clothesAdd.englishProductName | ellipsis}}
                   <!-- <a-input placeholder="请输入英文品名" v-model="clothesAdd.englishProductName"></a-input> -->
                 </a-form-model-item>
               </a-col>
@@ -419,6 +419,16 @@ export default {
   },
   created() {},
   mounted() {},
+  filters: {
+                //文字数超出时,超出部分使用...
+                ellipsis(value) {
+                    if (!value) return ''
+                    if (value.length > 20) {
+                        return value.slice(0, 30) + '...'
+                    }
+                    return value
+                }
+            },
   methods: {
     dynamicColumns(sizeTables){
        var newColumns = this.clothesAddColumns