Эх сурвалжийг харах

perf: 添加可配置高度

xingyu 2 жил өмнө
parent
commit
ca2cdc031d

+ 2 - 1
yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts

@@ -11,6 +11,7 @@ const message = useMessage() // 消息弹窗
 
 interface UseVxeGridConfig<T = any> {
   allSchemas: VxeAllSchemas
+  height?: number // 高度 默认730
   topActionSlots?: boolean // 是否开启表格内顶部操作栏插槽
   treeConfig?: VxeTablePropTypes.TreeConfig // 树形表单配置
   isList?: boolean // 是否不带分页的list
@@ -48,7 +49,7 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => {
   const gridOptions = reactive<VxeGridProps<any>>({
     loading: true,
     size: currentSize as any,
-    height: 730, // 1080高度
+    height: config?.height ? config.height : 730,
     rowConfig: {
       isCurrent: true, // 当鼠标点击行时,是否要高亮当前行
       isHover: true // 当鼠标移到行时,是否要高亮当前行