augsburg-mosaic/store/pinia.js
2023-11-01 20:27:34 +01:00

21 lines
446 B
JavaScript

import { defineStore } from 'pinia';
export const useMainStore = defineStore({
id: 'main',
state: () => ({
isMobile: false,
selectedLocation: null,
mapCenter: [48.371, 10.898],
mapZoom: 13,
}),
actions: {
setIsMobile(value) {
this.isMobile = value;
},
selectLocation(location) {
this.selectedLocation = location;
this.mapCenter = location.coordinates;
this.mapZoom = 15;
},
}
});