1. 弹幕功能

2. 点赞
3. 导航引导
4. ai弹幕、审核
This commit is contained in:
李琦
2026-08-01 17:13:49 +08:00
parent 9950b86841
commit 142a184f57
11 changed files with 285 additions and 23 deletions

View File

@@ -0,0 +1,36 @@
import { ref } from 'vue'
const toasts = ref([])
let seq = 0
function dismiss(id) {
toasts.value = toasts.value.filter((t) => t.id !== id)
}
function show(message, type = 'info', duration = 2400) {
const text = String(message || '').trim()
if (!text) return
const id = ++seq
toasts.value = [...toasts.value, { id, message: text, type }]
if (duration > 0) {
setTimeout(() => dismiss(id), duration)
}
return id
}
export function useToast() {
return {
toasts,
dismiss,
info: (msg, duration) => show(msg, 'info', duration),
success: (msg, duration) => show(msg, 'success', duration),
error: (msg, duration) => show(msg, 'error', duration),
}
}
export const toast = {
info: (msg, duration) => show(msg, 'info', duration),
success: (msg, duration) => show(msg, 'success', duration),
error: (msg, duration) => show(msg, 'error', duration),
dismiss,
}