extract to a new store: dashboardStore

This commit is contained in:
Julien Calixte
2023-07-24 23:06:59 +02:00
parent d5550cc53d
commit 53c8a43f51
7 changed files with 51 additions and 20 deletions

View File

@@ -0,0 +1,22 @@
import { Dashboard } from '@/store-type'
import { defineStore } from 'pinia'
type State = {
dashboards: Dashboard[]
}
export const useDashboardStore = defineStore('dashboard', {
state: (): State => {
return {
dashboards: []
}
},
actions: {
newDashboard(dashboard: Dashboard) {
this.dashboards.push(dashboard)
},
clearDashboard() {
this.dashboards = []
}
}
})