mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore(vue): add useCookie stub
This commit is contained in:
@@ -9,6 +9,22 @@ export { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
export const useAppConfig = () => appConfig
|
||||
|
||||
export const useCookie = <T = string>(
|
||||
_name: string,
|
||||
_options: Record<string, any> = {}
|
||||
) => {
|
||||
const value = ref(null) as Ref<T>
|
||||
|
||||
return {
|
||||
value,
|
||||
get: () => value.value,
|
||||
set: () => {},
|
||||
update: () => {},
|
||||
refresh: () => Promise.resolve(value.value),
|
||||
remove: () => {}
|
||||
}
|
||||
}
|
||||
|
||||
const state: Record<string, any> = {}
|
||||
|
||||
export const useState = <T>(key: string, init: () => T): Ref<T> => {
|
||||
|
||||
Reference in New Issue
Block a user