فهرست منبع

1. 不要0x,最终字符toUpperCase ✔️
2. 不要“个” ✔️
3. 不要那么多小数点(4位)✔️
4. 币种居左,数量居右 ✔️

龚成明 3 سال پیش
والد
کامیت
53b14b2428
1فایلهای تغییر یافته به همراه19 افزوده شده و 4 حذف شده
  1. 19 4
      src/components/History.vue

+ 19 - 4
src/components/History.vue

@@ -204,13 +204,15 @@
                           class="ma-2 tradeLabel"
                           @click="jump(trade.token, 'token')"
                           v-if="!trade.tokenSymbol && trade.token !== '0xeth'">
-                    {{ myKit._N(trade.amount, 6) }}个{{ getSimpleStr3(trade.token) }}
+                    <div class="tokenName">{{ getSimpleStr3(trade.token) }}</div>
+                    <div class="tokenAmount">{{ myKit._N(trade.amount, 4) }} </div>
                   </v-chip>
                   <v-chip label
                           color="blue lighten-4" class="ma-2 tradeLabel"
                           @click="jump(trade.token, 'token')"
                           v-else>
-                    {{ myKit._N(trade.amount, 6) }}个{{ trade.tokenSymbol }}
+                    <div class="tokenName">{{ trade.tokenSymbol }}</div>
+                    <div class="tokenAmount">{{ myKit._N(trade.amount, 4) }}</div>
                   </v-chip>
                   <!--from-->
                   <div>
@@ -342,8 +344,10 @@
       // 获取简易str3
       getSimpleStr3 (str) {
         if (str && str.indexOf('x') !== -1 && str.length > 15) {
-          return str.substr(0, 4)
-              + str.substr(str.length - 2, 2)
+          let new_str = str.replaceAll("0x", "").toUpperCase()
+
+          return new_str.substr(0, 2)
+              + new_str.substr(new_str.length - 2, 2)
         } else {
           return str
         }
@@ -480,4 +484,15 @@ thead.v-data-table-header {
   width: 95%;
   border-top: grey 1px solid;
 }
+div.tokenName {
+  text-align: left;
+  width: 100%;
+}
+div.tokenAmount {
+  text-align: right;
+  width: 100%;
+}
+span.v-chip__content {
+  width: 100%;
+}
 </style>