视频任务管理更新
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
export type ZiniaoVersion = 'new' | 'old'
|
||||
|
||||
const STORAGE_KEY = 'ziniao:version'
|
||||
|
||||
function loadZiniaoVersion(): ZiniaoVersion {
|
||||
if (typeof window === 'undefined') return 'new'
|
||||
return window.localStorage.getItem(STORAGE_KEY) === 'old' ? 'old' : 'new'
|
||||
}
|
||||
|
||||
export function useZiniaoVersion() {
|
||||
const ziniaoVersion = ref<ZiniaoVersion>(loadZiniaoVersion())
|
||||
|
||||
watch(ziniaoVersion, (value) => {
|
||||
if (typeof window !== 'undefined') window.localStorage.setItem(STORAGE_KEY, value)
|
||||
})
|
||||
|
||||
return ziniaoVersion
|
||||
}
|
||||
Reference in New Issue
Block a user