started workingon pinia, adding sample data
This commit is contained in:
@@ -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')
|
||||
|
||||
1202
src/sample-data/employees.json
Normal file
1202
src/sample-data/employees.json
Normal file
File diff suppressed because it is too large
Load Diff
1442
src/sample-data/shifts.json
Normal file
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
12
src/stores/employees.js
Normal 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
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user