Download packages/stores/src/modules/lock.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/stores/src/modules/lock.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/packages/stores/src/modules/lock.ts
-
curl -L -o lock.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/stores/src/modules/lock.ts
644 Bytes
| import { defineStore } from 'pinia'; | |
| interface AppState { | |
| /** | |
| * 是否锁屏状态 | |
| */ | |
| isLockScreen: boolean; | |
| /** | |
| * 锁屏密码 | |
| */ | |
| lockScreenPassword?: string; | |
| } | |
| export const useLockStore = defineStore('core-lock', { | |
| actions: { | |
| lockScreen(password: string) { | |
| this.isLockScreen = true; | |
| this.lockScreenPassword = password; | |
| }, | |
| unlockScreen() { | |
| this.isLockScreen = false; | |
| this.lockScreenPassword = undefined; | |
| }, | |
| }, | |
| persist: { | |
| pick: ['isLockScreen', 'lockScreenPassword'], | |
| }, | |
| state: (): AppState => ({ | |
| isLockScreen: false, | |
| lockScreenPassword: undefined, | |
| }), | |
| }); | |