initial version
This commit is contained in:
21
store/pinia.js
Normal file
21
store/pinia.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
},
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user