This commit is contained in:
dap
2024-10-05 13:16:24 +08:00
14 changed files with 2524 additions and 378 deletions

View File

@@ -53,13 +53,20 @@ function transformComponent(
component: VNode,
route: RouteLocationNormalizedLoadedGeneric,
) {
// 组件视图未找到,如果有设置后备视图,则返回后备视图,如果没有,则抛出错误
if (!component) {
console.error(
'Component view not foundplease check the route configuration',
);
return undefined;
}
const routeName = route.name as string;
// 如果组件没有 name则直接返回
if (!routeName) {
return component;
}
const componentName = (component.type as any).name;
const componentName = (component?.type as any)?.name;
// 已经设置过 name则直接返回
if (componentName) {

View File

@@ -150,7 +150,7 @@ function removeItem(index: number) {
} else {
searchHistory.value.splice(index, 1);
}
activeIndex.value = activeIndex.value - 1 >= 0 ? activeIndex.value - 1 : 0;
activeIndex.value = Math.max(activeIndex.value - 1, 0);
scrollIntoView();
}

View File

@@ -174,12 +174,15 @@ if (enableShortcutKey.value) {
/>
<div class="ml-2 w-full">
<div
v-if="tagText || text || $slots.tagText"
class="text-foreground mb-1 flex items-center text-sm font-medium"
>
{{ text }}
<Badge class="ml-2 text-green-400">
{{ tagText }}
</Badge>
<slot name="tagText">
<Badge v-if="tagText" class="ml-2 text-green-400">
{{ tagText }}
</Badge>
</slot>
</div>
<div class="text-muted-foreground text-xs font-normal">
{{ description }}
@@ -208,7 +211,7 @@ if (enableShortcutKey.value) {
{{ altView }} L
</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuSeparator v-if="preferences.widget.lockScreen" />
<DropdownMenuItem
class="mx-1 flex cursor-pointer items-center rounded-sm py-1 leading-8"
@click="handleLogout"