started workingon pinia, adding sample data

This commit is contained in:
Sockenklaus
2021-10-05 00:13:41 +02:00
parent c378553d8c
commit 44b2c70327
8 changed files with 2675 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import "bootstrap"
@@ -7,4 +8,5 @@ import "bootstrap-icons/font/bootstrap-icons.css"
createApp(App)
.use(router)
.use(createPinia())
.mount('#app')

File diff suppressed because it is too large Load Diff

1442
src/sample-data/shifts.json Normal file

File diff suppressed because it is too large Load Diff

12
src/stores/employees.js Normal file
View File

@@ -0,0 +1,12 @@
import { defineStore } from 'pinia'
import emplJSON from '../sample-data/employees.json'
export const useEmployees = defineStore('employees', {
state: () => {
return {
/** @type {{id: number, name: string, handle: string, contractHours: number }[]} */
employees: emplJSON
}
},
})

View File

@@ -10,6 +10,7 @@ div(class="mt-5" v-for="(month, index) in months" :key="index")
<script lang="ts" setup>
import { ref, computed } from 'vue'
import { getYear, getMonth, eachMonthOfInterval, getDaysInMonth, getISODay } from 'date-fns'
import { storeToRefs } from 'pinia'
import Schedule from '/src/components/Schedule.vue'
import MonthPicker from '/src/components/MonthPicker.vue'