1234567891011121314151617181920212223242526 |
- import { ConstantLocalStorage } from '@/utils/constant'
- import { ConstantStore } from '@/utils/constant'
- import { defineStore } from 'pinia'
- import { useLocalStorageState } from 'vue-hooks-plus'
- export const useOpraRecordStore = defineStore(ConstantStore.OPRARECORDS, () => {
- const [ state, setState ] = useLocalStorageState<API.LearnPlanRecords[]>(ConstantLocalStorage.OPRARECORDS, {
- defaultValue: []
- })
- const _push = (records: any) => setState([...state.value!, records])
- const _clear = () => setState([])
- const _get = () => state.value
- return {
- push: _push,
- get: _get,
- clear: _clear,
- length: state.value?.length
- }
- })
|