Работа над интерактивным обучением
This commit is contained in:
13
resources/js/Stores/modals.js
Normal file
13
resources/js/Stores/modals.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import {defineStore} from "pinia";
|
||||
import {computed, ref} from "vue";
|
||||
import {tours} from "../config/tours.js";
|
||||
|
||||
export const useModalStore = defineStore('modals', () => {
|
||||
const showSelectDutyUserModal = ref(false)
|
||||
const showSelectNurseUserModal = ref(false)
|
||||
|
||||
return {
|
||||
showSelectDutyUserModal,
|
||||
showSelectNurseUserModal,
|
||||
}
|
||||
})
|
||||
40
resources/js/Stores/onboarding.js
Normal file
40
resources/js/Stores/onboarding.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import {defineStore} from "pinia";
|
||||
import {computed, ref} from "vue";
|
||||
import {tours} from "../config/tours.js";
|
||||
|
||||
export const useOnboardingStore = defineStore('onboarding', () => {
|
||||
const activeTourId = ref(null)
|
||||
const activeStepIndex = ref(0)
|
||||
const isActive = ref(false)
|
||||
|
||||
const currentTourSteps = computed(() => {
|
||||
if (!activeTourId.value) return []
|
||||
return tours[activeTourId.value]?.steps || []
|
||||
})
|
||||
|
||||
const startTour = (tourId, startFrom = 0) => {
|
||||
activeTourId.value = tourId
|
||||
activeStepIndex.value = startFrom
|
||||
isActive.value = true
|
||||
}
|
||||
|
||||
const setStep = (index) => {
|
||||
activeStepIndex.value = index
|
||||
}
|
||||
|
||||
const finish = () => {
|
||||
activeTourId.value = null
|
||||
activeStepIndex.value = 0
|
||||
isActive.value = false
|
||||
}
|
||||
|
||||
return {
|
||||
activeTourId,
|
||||
activeStepIndex,
|
||||
isActive,
|
||||
currentTourSteps,
|
||||
startTour,
|
||||
finish,
|
||||
setStep
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user