getCookie 제거

This commit is contained in:
2026-01-10 21:59:11 +09:00
parent ef7914d5c6
commit 1b8cd8577e
30 changed files with 195 additions and 145 deletions

View File

@@ -0,0 +1,60 @@
/**
* Bootstrap Toast Composable
* 전역 토스트 메시지 관리
*/
interface ToastMessage {
id: number
type: 'success' | 'error' | 'warning' | 'info'
title?: string
message: string
duration?: number
}
const toasts = ref<ToastMessage[]>([])
let toastId = 0
export function useToast() {
function show(message: string, type: ToastMessage['type'] = 'info', title?: string, duration = 3000) {
const id = ++toastId
toasts.value.push({ id, type, title, message, duration })
if (duration > 0) {
setTimeout(() => {
remove(id)
}, duration)
}
}
function success(message: string, title?: string, duration = 3000) {
show(message, 'success', title || '성공', duration)
}
function error(message: string, title?: string, duration = 5000) {
show(message, 'error', title || '오류', duration)
}
function warning(message: string, title?: string, duration = 4000) {
show(message, 'warning', title || '경고', duration)
}
function info(message: string, title?: string, duration = 3000) {
show(message, 'info', title || '알림', duration)
}
function remove(id: number) {
const idx = toasts.value.findIndex(t => t.id === id)
if (idx > -1) {
toasts.value.splice(idx, 1)
}
}
return {
toasts,
show,
success,
error,
warning,
info,
remove
}
}