Spookie/assets/js/stores/QuotesStore.js

14 lines
254 B
JavaScript
Raw Normal View History

2022-05-06 13:52:18 +02:00
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;
}
}
});