diff --git a/resources/basya.js b/resources/basya.js index 2cb0e3d..2db730f 100644 --- a/resources/basya.js +++ b/resources/basya.js @@ -1,5 +1,6 @@ import './js/bootstrap'; import {createApp} from 'vue' +import { createPinia } from 'pinia' import App from './views/basya/Basya.vue' import { createVuetify } from 'vuetify' import { mdi } from "vuetify/iconsets/mdi"; @@ -8,9 +9,11 @@ import * as components from 'vuetify/components' import * as directives from 'vuetify/directives' import '@mdi/font/css/materialdesignicons.css' +const pinia = createPinia(); + const vuetify = createVuetify({ components, directives }) -createApp(App).use(vuetify).mount("#app") +createApp(App).use(vuetify).use(pinia).mount("#app") diff --git a/resources/stores/basya.js b/resources/stores/basya.js new file mode 100644 index 0000000..e0e281c --- /dev/null +++ b/resources/stores/basya.js @@ -0,0 +1,20 @@ +import {defineStore} from "pinia"; +import axios from "axios"; + +export const useBasyaStore = defineStore('basya', { + state: () => ({ + phrases: Object + }), + getters: { + + }, + actions: { + async getPhrases(){ + await axios + .get('/api/v1/phrases') + .then((response) => { + this.phrases = response.data; + }); + } + }, +}) diff --git a/resources/stores/schedule.js b/resources/stores/schedule.js index 40ab9b0..8715282 100644 --- a/resources/stores/schedule.js +++ b/resources/stores/schedule.js @@ -1,7 +1,7 @@ import {defineStore} from "pinia"; import axios from "axios"; -export const useScheduleStore = defineStore('Schedule', { +export const useScheduleStore = defineStore('schedule', { state: () => ({ dates: Object, links: Object, diff --git a/resources/views/basya/Basya.vue b/resources/views/basya/Basya.vue index 905413a..36cc44d 100644 --- a/resources/views/basya/Basya.vue +++ b/resources/views/basya/Basya.vue @@ -34,7 +34,8 @@