|
|
|
@ -56,7 +56,7 @@ |
|
|
|
<td class="w-33 text-right"> |
|
|
|
{{ coin.coin_name == 'fav' ? item.close : item.price}} |
|
|
|
</td> |
|
|
|
<td class="w-33 text-right" :class="item.increaseStr.startsWith('-') ? 'red' : 'green'"> |
|
|
|
<td class="w-33 text-right" :class="getItemClass(item)"> |
|
|
|
{{ item.increaseStr }} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
@ -228,6 +228,14 @@ export default { |
|
|
|
this.favList.marketInfoList = res||[]; |
|
|
|
}) |
|
|
|
.catch((err) => {}); |
|
|
|
}, |
|
|
|
// 判断是否有 - 号 |
|
|
|
getItemClass(item) { |
|
|
|
if (item && item.increaseStr && item.increaseStr.indexOf('-') === 0) { |
|
|
|
return 'red'; |
|
|
|
} else { |
|
|
|
return 'green'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|