diff --git a/src/store/stock-quote/index.js b/src/store/stock-quote/index.js index 64b07f1..df54172 100644 --- a/src/store/stock-quote/index.js +++ b/src/store/stock-quote/index.js @@ -14,11 +14,25 @@ export const useStockQuote = createGlobalState(() => { "" ] }) + 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 = ref(date.toLocaleString('en-US', options)) const getStockQuate= async()=>{ const res = await axios.get('https://saas-test.szjixun.cn/api/chart/forward/test') stockQuote.value=res.data } return { + formatted, getStockQuate, stockQuote } diff --git a/src/views/stock-quote/size1920/index.vue b/src/views/stock-quote/size1920/index.vue index 3c6288f..edcfd0f 100644 --- a/src/views/stock-quote/size1920/index.vue +++ b/src/views/stock-quote/size1920/index.vue @@ -1,19 +1,7 @@ diff --git a/src/views/stock-quote/size375/index.vue b/src/views/stock-quote/size375/index.vue index 3ca6e28..68efba0 100644 --- a/src/views/stock-quote/size375/index.vue +++ b/src/views/stock-quote/size375/index.vue @@ -1,6 +1,6 @@ @@ -8,8 +8,9 @@ getStockQuate(); - $1.98 - NASDAQ: UK + ${{ stockQuote.change?.[0].slice(0,4) }} + NASDAQ: MINM + {{ formatted }}