修正股票变动颜色逻辑:将负值显示为绿色,正值显示为红色,确保在不同屏幕尺寸下的一致性。
This commit is contained in:
parent
1bdea06916
commit
0b000f2eb0
@ -25,7 +25,7 @@ getStockQuate()
|
||||
<div class="info-card">
|
||||
<div class="text-base text-gray-400">% Change</div>
|
||||
<div class="text-3xl font-bold"
|
||||
:class="stockQuote.change?.includes('-') ? 'text-red-500' : (stockQuote.change?.includes('+') ? 'text-green-500' : '')">
|
||||
:class="stockQuote.change?.includes('-') ? 'text-green-500' : 'text-red-500'">
|
||||
{{ stockQuote.change }}</div>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
|
@ -28,7 +28,7 @@ getStockQuate()
|
||||
:class="stockQuote.change?.[1]?.startsWith('-') ? 'text-red-500' : (stockQuote.change?.[1]?.startsWith('+') ? 'text-green-500' : '')">
|
||||
{{ stockQuote.change?.join('') }}</div> -->
|
||||
<div class="text-3xl font-bold"
|
||||
:class="stockQuote.change?.includes('-') ? 'text-red-500' : (stockQuote.change?.includes('+') ? 'text-green-500' : '')">
|
||||
:class="stockQuote.change?.includes('-') ? 'text-green-500' : 'text-red-500'">
|
||||
{{ stockQuote.change }}</div>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
|
@ -22,7 +22,7 @@ getStockQuate();
|
||||
<div class="text-xs text-gray-400">% Change</div>
|
||||
|
||||
<div class="text-lg font-bold"
|
||||
:class="stockQuote.change?.includes('-') ? 'text-red-500' : (stockQuote.change?.includes('+') ? 'text-green-500' : '')">
|
||||
:class="stockQuote.change?.includes('-') ? 'text-green-500' : 'text-red-500'">
|
||||
{{ stockQuote.change }}</div>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
|
@ -25,7 +25,7 @@ getStockQuate();
|
||||
<div class="info-card">
|
||||
<div class="text-sm text-gray-400">% Change</div>
|
||||
<div class="text-xl font-bold"
|
||||
:class="stockQuote.change?.includes('-') ? 'text-red-500' : (stockQuote.change?.includes('+') ? 'text-green-500' : '')">
|
||||
:class="stockQuote.change?.includes('-') ? 'text-green-500' : 'text-red-500'">
|
||||
{{ stockQuote.change }}</div>
|
||||
</div>
|
||||
<div class="info-card">
|
||||
|
Loading…
Reference in New Issue
Block a user