feat: enhance DraggableWindow component with additional emit events for window control; update hotnews component to handle pending state; modify home link for improved navigation

This commit is contained in:
yuanhau 2025-05-12 21:05:14 +08:00
parent 71aac20c36
commit 57aa0aba18
4 changed files with 17 additions and 7 deletions

View file

@ -9,7 +9,9 @@ const props = defineProps<{
height?: string;
}>();
const emit = defineEmits(["close"]);
const emit = defineEmits(["close", "min", "maximize", "restore"]);
const title = computed(() => props.title || 'Draggable Window');
const isDragging = ref(false);
const position = ref({
@ -65,11 +67,17 @@ const stopDrag = () => {
<h3 class="font-semibold">{{ title }}</h3>
<div class="flex flex-row gap-1">
<button
@click="emit('close')"
@click="emit('min')"
class="p-1 hover:bg-gray-300 dark:hover:bg-gray-600 rounded"
>
</button>
<button
@click="emit('maximize')"
class="p-1 hover:bg-gray-300 dark:hover:bg-gray-600 rounded"
>
</button>
<button
@click="emit('close')"
class="p-1 rounded bg-red-500 text-white hover:bg-red-600 transition duration-200"