enkapsulacja i uporządkowanie komponentów

This commit is contained in:
2023-07-10 13:47:09 +02:00
parent e532c9f2da
commit 073288c8a9
8 changed files with 230 additions and 143 deletions
+20
View File
@@ -56,5 +56,25 @@ export const useStore = defineStore({
chosenRealStock: (state) => chosenRealStock(state),
acceptableMass: (state) => acceptableMass(state),
},
actions: {
async fetchStockInfoData() {
const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json();
this.stockData = stockData;
},
handleRouting() {
switch (window.location.pathname) {
case '/numgnr':
this.stockSectionMode = 'number-generator';
break;
case '/stockgnr':
this.stockSectionMode = 'stock-generator';
break;
default:
break;
}
},
},
});