feat: add click-to-click event support to the WorkenchProject and WorkenchQuickNav components (#4831)

* feat(@vben/common-ui): add click event emission to WorkbenchProject and WorkbenchQuickNav components

* feat: add navigation and project link functionality to dashboard workspace

* feat: add URL property to WorkbenchProjectItem and WorkbenchQuickNavItem for enhanced navigation

---------

Co-authored-by: XiaoyuDing <xiaoyuding@keymedbio.com>
This commit is contained in:
Xiaoyu
2024-11-09 10:26:58 +08:00
committed by GitHub
parent 8f1e397077
commit da7d61b160
7 changed files with 160 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ interface WorkbenchProjectItem {
group: string;
icon: Component | string;
title: string;
url?: string;
}
interface WorkbenchTrendItem {
@@ -35,6 +36,7 @@ interface WorkbenchQuickNavItem {
color?: string;
icon: Component | string;
title: string;
url?: string;
}
export type {

View File

@@ -21,6 +21,8 @@ defineOptions({
withDefaults(defineProps<Props>(), {
items: () => [],
});
defineEmits(['click']);
</script>
<template>
@@ -43,6 +45,7 @@ withDefaults(defineProps<Props>(), {
:color="item.color"
:icon="item.icon"
class="size-8 transition-all duration-300 group-hover:scale-110"
@click="$emit('click', item)"
/>
<span class="ml-4 text-lg font-medium">{{ item.title }}</span>
</div>

View File

@@ -21,6 +21,8 @@ defineOptions({
withDefaults(defineProps<Props>(), {
items: () => [],
});
defineEmits(['click']);
</script>
<template>
@@ -37,6 +39,7 @@ withDefaults(defineProps<Props>(), {
'border-b-0': index < 3,
}"
class="flex-col-center border-border group w-1/3 cursor-pointer border-b border-r border-t py-8 hover:shadow-xl"
@click="$emit('click', item)"
>
<VbenIcon
:color="item.color"