Spookie/assets/js/stores/QuotesStore.js

14 lines
254 B
JavaScript

import { defineStore } from 'pinia';
import axios from 'axios';
export const useQuotesStore = defineStore('QuotesStore', {
state: () => ({
quotes: []
}),
actions: {
async fill() {
this.quotes = (await axios.get('api/quotes')).data;
}
}
});