chat-pc/src/hooks/useProvideUserModal.ts
2024-12-24 16:14:21 +08:00

21 lines
345 B
TypeScript

import { ref, provide } from 'vue'
export function useProvideUserModal() {
const isShow = ref(false)
const uid = ref(0)
const show = (id: number) => {
uid.value = id
isShow.value = true
}
const close = () => {
uid.value = 0
isShow.value = false
}
provide('$user', show)
return { isShow, uid, show, close }
}