fix: fix a series of known problems,fixed #54
This commit is contained in:
@@ -35,7 +35,7 @@ function handleClick(path?: string) {
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
:icon="item.icon"
|
||||
class="mr-1 size-5 flex-shrink-0"
|
||||
class="mr-1 size-4 flex-shrink-0"
|
||||
/>
|
||||
<span
|
||||
:class="{
|
||||
|
@@ -1,15 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* Logo 图标 alt
|
||||
*/
|
||||
alt?: string;
|
||||
/**
|
||||
* 是否收起文本
|
||||
*/
|
||||
collapse?: boolean;
|
||||
collapsed?: boolean;
|
||||
/**
|
||||
* Logo 跳转地址
|
||||
*/
|
||||
@@ -25,7 +19,7 @@ interface Props {
|
||||
/**
|
||||
* Logo 文本
|
||||
*/
|
||||
text?: string;
|
||||
text: string;
|
||||
/**
|
||||
* Logo 主题
|
||||
*/
|
||||
@@ -33,39 +27,34 @@ interface Props {
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: 'Logo',
|
||||
name: 'VbenLogo',
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
alt: 'Vben',
|
||||
collapse: false,
|
||||
withDefaults(defineProps<Props>(), {
|
||||
collapsed: false,
|
||||
href: 'javascript:void 0',
|
||||
logoSize: 36,
|
||||
logoSize: 32,
|
||||
src: '',
|
||||
text: '',
|
||||
theme: 'light',
|
||||
});
|
||||
const logoClass = computed(() => {
|
||||
return [props.theme, props.collapse ? 'collapsed' : ''];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="logoClass" class="flex h-full items-center text-lg">
|
||||
<div :class="theme" class="flex h-full items-center text-lg">
|
||||
<a
|
||||
:class="$attrs.class"
|
||||
:href="href"
|
||||
class="flex h-full items-center gap-2 overflow-hidden px-3 font-semibold leading-normal transition-all duration-500"
|
||||
class="flex h-full items-center gap-2 overflow-hidden px-3 text-lg font-semibold leading-normal transition-all duration-500"
|
||||
>
|
||||
<img
|
||||
v-if="src"
|
||||
:alt="alt"
|
||||
:alt="text"
|
||||
:src="src"
|
||||
:width="logoSize"
|
||||
class="relative rounded-none bg-transparent"
|
||||
/>
|
||||
<span
|
||||
v-if="!collapse"
|
||||
v-if="!collapsed"
|
||||
class="text-primary dark:text-foreground truncate text-nowrap"
|
||||
>
|
||||
{{ text }}
|
||||
|
@@ -49,7 +49,7 @@ const badgeStyle = computed(() => {
|
||||
v-else
|
||||
:class="badgeClass"
|
||||
:style="badgeStyle"
|
||||
class="rounded-md px-1.5 py-0.5 text-xs"
|
||||
class="text-primary-foreground rounded-xl px-1.5 py-0.5 text-xs"
|
||||
>
|
||||
{{ badge }}
|
||||
</div>
|
||||
|
@@ -12,12 +12,14 @@ interface Props {
|
||||
class?: HTMLAttributes['class'];
|
||||
horizontal?: boolean;
|
||||
shadow?: boolean;
|
||||
shadowBorder?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
class: '',
|
||||
horizontal: false,
|
||||
shadow: false,
|
||||
shadowBorder: false,
|
||||
});
|
||||
|
||||
const isAtTop = ref(true);
|
||||
@@ -42,7 +44,8 @@ function handleScroll(event: Event) {
|
||||
<div
|
||||
v-if="shadow"
|
||||
:class="{
|
||||
'border-border border-t opacity-100': !isAtTop,
|
||||
'opacity-100': !isAtTop,
|
||||
'border-border border-t': shadowBorder && !isAtTop,
|
||||
}"
|
||||
class="scrollbar-top-shadow pointer-events-none absolute top-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"
|
||||
></div>
|
||||
@@ -50,7 +53,8 @@ function handleScroll(event: Event) {
|
||||
<div
|
||||
v-if="shadow"
|
||||
:class="{
|
||||
'border-border border-b opacity-100': !isAtTop && !isAtBottom,
|
||||
'opacity-100': !isAtTop && !isAtBottom,
|
||||
'border-border border-t': shadowBorder && !isAtTop && !isAtBottom,
|
||||
}"
|
||||
class="scrollbar-bottom-shadow pointer-events-none absolute bottom-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"
|
||||
></div>
|
||||
|
Reference in New Issue
Block a user