diff --git a/.gitignore b/.gitignore index 6999898..3331163 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ pnpm-debug.log* *.sln *.sw? node_modules + +# Dev files +stockInfoDev.json \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 54bce06..ad9d7d3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,13 +73,13 @@ export default defineComponent({ }), async created() { - const stockData = await ( - await fetch( - `https://spythere.github.io/api/td2/data/stockInfo${import.meta.env['VITE_STOCK_DEV'] == '1' ? 'Dev' : ''}.json` - ) - ).json(); - - this.store.stockData = stockData; + if (import.meta.env['VITE_STOCK_DEV'] == '1') { + const data = await import('../stockInfoDev.json'); + this.store.stockData = data.default as any; + } else { + const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json(); + this.store.stockData = stockData; + } // routing switch (window.location.pathname) { diff --git a/src/types.ts b/src/types.ts index c817477..2f4d482 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,7 +42,7 @@ export interface IStockProps { export interface IStockData { generator: { - passenger: []; + passenger: any; cargo: { [key: string]: string[]; };