添加股票报价页面的时间格式化功能,并更新NASDAQ显示的股票代码
This commit is contained in:
parent
15b15e0351
commit
c4f61ddc3c
@ -1,7 +1,19 @@
|
||||
<script setup>
|
||||
import {useStockQuote} from '@/store/stock-quote/index.js'
|
||||
const {getStockQuate,stockQuote}=useStockQuote()
|
||||
const date = new Date();
|
||||
const options = {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
hour12: true,
|
||||
timeZone: 'America/New_York',
|
||||
timeZoneName: 'short'
|
||||
};
|
||||
|
||||
const formatted = date.toLocaleString('en-US', options);
|
||||
getStockQuate()
|
||||
</script>
|
||||
|
||||
@ -13,7 +25,8 @@ getStockQuate()
|
||||
<!-- 左侧大号价格 -->
|
||||
<section class="flex flex-col items-center justify-center glass-card p-32 rounded-2xl shadow-xl ">
|
||||
<div class="text-9xl font-extrabold text-#8A5AFB animate-bg-move select-none drop-shadow-lg">${{ stockQuote.change?.[0].slice(0,4) }}</div>
|
||||
<div class="mt-10 text-3xl text-gray-500 font-semibold tracking-widest">NASDAQ: <span class="text-black">UK</span></div>
|
||||
<div class="mt-10 text-3xl text-gray-500 font-semibold tracking-widest mb-10px">NASDAQ: <span class="text-black">MINM</span></div>
|
||||
<div class="text-gray-500">{{ formatted }}</div>
|
||||
</section>
|
||||
<!-- 右侧信息卡片 -->
|
||||
<section class="grid grid-cols-2 gap-16">
|
||||
|
Loading…
Reference in New Issue
Block a user