fix: 修复多个UI样式问题和优化代码格式
-调整VXE表格搜索表单和分页样式间距 -优化use-layout-style和use-priority-value代码格式
This commit is contained in:
@@ -36,14 +36,11 @@ export function useLayoutContentStyle() {
|
||||
};
|
||||
});
|
||||
|
||||
const debouncedCalcHeight = useDebounceFn(
|
||||
(_entries: ResizeObserverEntry[]) => {
|
||||
visibleDomRect.value = getElementVisibleRect(contentElement.value);
|
||||
contentHeight.value = `${visibleDomRect.value.height}px`;
|
||||
contentWidth.value = `${visibleDomRect.value.width}px`;
|
||||
},
|
||||
16,
|
||||
);
|
||||
const debouncedCalcHeight = useDebounceFn((_entries: ResizeObserverEntry[]) => {
|
||||
visibleDomRect.value = getElementVisibleRect(contentElement.value);
|
||||
contentHeight.value = `${visibleDomRect.value.height}px`;
|
||||
contentWidth.value = `${visibleDomRect.value.width}px`;
|
||||
}, 16);
|
||||
|
||||
onMounted(() => {
|
||||
if (contentElement.value && !resizeObserver) {
|
||||
|
||||
@@ -2,10 +2,7 @@ import type { ComputedRef, Ref } from 'vue';
|
||||
|
||||
import { computed, getCurrentInstance, unref, useAttrs, useSlots } from 'vue';
|
||||
|
||||
import {
|
||||
getFirstNonNullOrUndefined,
|
||||
kebabToCamelCase,
|
||||
} from '@vben-core/shared/utils';
|
||||
import { getFirstNonNullOrUndefined, kebabToCamelCase } from '@vben-core/shared/utils';
|
||||
|
||||
/**
|
||||
* 依次从插槽、attrs、props、state 中获取值
|
||||
@@ -32,8 +29,7 @@ export function usePriorityValue<
|
||||
for (const [key, value] of Object.entries(rawProps)) {
|
||||
standardRawProps[kebabToCamelCase(key) as K] = value;
|
||||
}
|
||||
const propsKey =
|
||||
standardRawProps?.[key] === undefined ? undefined : props[key];
|
||||
const propsKey = standardRawProps?.[key] === undefined ? undefined : props[key];
|
||||
|
||||
// slot可以关闭
|
||||
return getFirstNonNullOrUndefined(
|
||||
@@ -77,11 +73,7 @@ export function useForwardPriorityValues<
|
||||
const computedResult: { [K in keyof T]: ComputedRef<T[K]> } = {} as never;
|
||||
|
||||
(Object.keys(props) as (keyof T)[]).forEach((key) => {
|
||||
computedResult[key] = usePriorityValue(
|
||||
key as keyof typeof props,
|
||||
props,
|
||||
state,
|
||||
);
|
||||
computedResult[key] = usePriorityValue(key as keyof typeof props, props, state);
|
||||
});
|
||||
|
||||
return computed(() => {
|
||||
|
||||
@@ -184,7 +184,7 @@ const options = computed(() => {
|
||||
pageSize: 20,
|
||||
background: true,
|
||||
pageSizes: [10, 20, 30, 50, 100, 200],
|
||||
className: 'mt-2 w-full',
|
||||
className: 'mt-1 w-full',
|
||||
layouts: isMobile.value ? mobileLayouts : layouts,
|
||||
size: 'mini' as const,
|
||||
});
|
||||
@@ -362,8 +362,8 @@ onUnmounted(() => {
|
||||
v-show="showSearchForm !== false"
|
||||
:class="
|
||||
cn(
|
||||
'relative rounded py-3',
|
||||
isCompactForm ? (isSeparator ? 'pb-8' : 'pb-4') : isSeparator ? 'pb-4' : 'pb-0',
|
||||
'relative rounded py-2',
|
||||
isCompactForm ? (isSeparator ? 'pb-4' : 'pb-2') : isSeparator ? 'pb-2' : 'pb-0',
|
||||
)
|
||||
"
|
||||
>
|
||||
@@ -395,9 +395,10 @@ onUnmounted(() => {
|
||||
:style="{
|
||||
...(separatorBg ? { backgroundColor: separatorBg } : undefined),
|
||||
}"
|
||||
class="bg-background-deep z-100 absolute -left-2 bottom-1 h-2 w-[calc(100%+1rem)] overflow-hidden md:bottom-2 md:h-3"
|
||||
class="bg-background-deep z-100 absolute -left-2 bottom-0 h-1 w-[calc(100%+1rem)] overflow-hidden md:bottom-0 md:h-2"
|
||||
></div>
|
||||
</div>
|
||||
<div v-if="!showToolbar && formOptions" class="h-2 bg-white"></div>
|
||||
</template>
|
||||
<!-- loading -->
|
||||
<template #loading>
|
||||
|
||||
Reference in New Issue
Block a user