środowisko dev

This commit is contained in:
2023-07-04 23:44:06 +02:00
parent 79d5413638
commit 5ba9e95547
3 changed files with 11 additions and 8 deletions
+3
View File
@@ -23,3 +23,6 @@ pnpm-debug.log*
*.sln
*.sw?
node_modules
# Dev files
stockInfoDev.json
+7 -7
View File
@@ -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) {
+1 -1
View File
@@ -42,7 +42,7 @@ export interface IStockProps {
export interface IStockData {
generator: {
passenger: [];
passenger: any;
cargo: {
[key: string]: string[];
};