ui หน้าสมัครสอบ
This commit is contained in:
parent
03b6076835
commit
792f30d606
48 changed files with 2845 additions and 43 deletions
26
src/modules/01_exam/store.ts
Normal file
26
src/modules/01_exam/store.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useExamDataStore = defineStore('exam', () => {
|
||||
interface exam {
|
||||
main: { columns: String[] }
|
||||
}
|
||||
|
||||
const examData = ref<exam>({
|
||||
main: { columns: [] }
|
||||
})
|
||||
|
||||
const changeExamColumns = (system: String, val: String[]) => {
|
||||
if (system == 'main') examData.value.main.columns = val
|
||||
localStorage.setItem('exam', JSON.stringify(examData.value))
|
||||
}
|
||||
|
||||
if (localStorage.getItem('exam') !== null) {
|
||||
examData.value = JSON.parse(localStorage.getItem('exam') || '{}')
|
||||
}
|
||||
|
||||
return {
|
||||
examData,
|
||||
changeExamColumns
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue