mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
fix(layout): fix layout scale error
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
- 修复表格列配置已知问题
|
- 修复表格列配置已知问题
|
||||||
- 恢复 table 的`isTreeTable`属性
|
- 恢复 table 的`isTreeTable`属性
|
||||||
|
- 修复表格内存溢出问题
|
||||||
|
- 修复`layout` 收缩展开功能在分割模式下失效
|
||||||
|
|
||||||
## 2.0.0-rc.15 (2020-12-31)
|
## 2.0.0-rc.15 (2020-12-31)
|
||||||
|
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||||
import BasicArrow from './src/BasicArrow.vue';
|
import BasicArrow from './src/BasicArrow.vue';
|
||||||
|
import BasicTitle from './src/BasicTitle.vue';
|
||||||
|
|
||||||
export { BasicArrow };
|
export { BasicArrow, BasicTitle };
|
||||||
|
|
||||||
// export const BasicArrow = createAsyncComponent(() => import('./src/BasicArrow.vue'));
|
// export const BasicArrow = createAsyncComponent(() => import('./src/BasicArrow.vue'));
|
||||||
export const BasicHelp = createAsyncComponent(() => import('./src/BasicHelp.vue'));
|
export const BasicHelp = createAsyncComponent(() => import('./src/BasicHelp.vue'));
|
||||||
export const BasicTitle = createAsyncComponent(() => import('./src/BasicTitle.vue'));
|
// export const BasicTitle = createAsyncComponent(() => import('./src/BasicTitle.vue'));
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
// import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||||
export const Description = createAsyncComponent(() => import('./src/index'));
|
// export const Description = createAsyncComponent(() => import('./src/index'));
|
||||||
|
|
||||||
|
import Description from './src/index';
|
||||||
|
|
||||||
|
export { Description };
|
||||||
export * from './src/types';
|
export * from './src/types';
|
||||||
export { useDescription } from './src/useDescription';
|
export { useDescription } from './src/useDescription';
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||||
|
|
||||||
export const BasicMenu = createAsyncComponent(() => import('./src/BasicMenu.vue'));
|
import BasicMenu from './src/BasicMenu.vue';
|
||||||
|
|
||||||
|
// export const BasicMenu = createAsyncComponent(() => import('./src/BasicMenu.vue'));
|
||||||
|
|
||||||
export const MenuTag = createAsyncComponent(() => import('./src/components/MenuItemTag.vue'));
|
export const MenuTag = createAsyncComponent(() => import('./src/components/MenuItemTag.vue'));
|
||||||
|
|
||||||
|
export { BasicMenu };
|
||||||
|
@@ -23,7 +23,6 @@ export function useOpenKeys(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const native = unref(getIsMixSidebar) && unref(getMixSideFixed);
|
const native = unref(getIsMixSidebar) && unref(getMixSideFixed);
|
||||||
|
|
||||||
useTimeoutFn(
|
useTimeoutFn(
|
||||||
() => {
|
() => {
|
||||||
const menuList = toRaw(menus.value);
|
const menuList = toRaw(menus.value);
|
||||||
@@ -37,7 +36,7 @@ export function useOpenKeys(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
16,
|
16,
|
||||||
native
|
!native
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -148,10 +148,16 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
console.log('======================');
|
||||||
|
console.log(1);
|
||||||
|
console.log('======================');
|
||||||
defaultValueRef.value = props.value;
|
defaultValueRef.value = props.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
console.log('======================');
|
||||||
|
console.log(2);
|
||||||
|
console.log('======================');
|
||||||
const { editable } = props.column;
|
const { editable } = props.column;
|
||||||
if (isBoolean(editable) || isBoolean(unref(getRowEditable))) {
|
if (isBoolean(editable) || isBoolean(unref(getRowEditable))) {
|
||||||
isEdit.value = !!editable || unref(getRowEditable);
|
isEdit.value = !!editable || unref(getRowEditable);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import type { BasicTableProps, FetchParams, SorterResult } from '../types/table';
|
import type { BasicTableProps, FetchParams, SorterResult } from '../types/table';
|
||||||
import type { PaginationProps } from '../types/pagination';
|
import type { PaginationProps } from '../types/pagination';
|
||||||
|
|
||||||
import { ref, unref, ComputedRef, computed, onMounted, watchEffect, reactive } from 'vue';
|
import { ref, unref, ComputedRef, computed, onMounted, watch, reactive } from 'vue';
|
||||||
|
|
||||||
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
|
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
|
||||||
|
|
||||||
@@ -40,10 +40,21 @@ export function useDataSource(
|
|||||||
});
|
});
|
||||||
const dataSourceRef = ref<Recordable[]>([]);
|
const dataSourceRef = ref<Recordable[]>([]);
|
||||||
|
|
||||||
watchEffect(() => {
|
// watchEffect(() => {
|
||||||
|
// const { dataSource, api } = unref(propsRef);
|
||||||
|
// !api && dataSource && (dataSourceRef.value = dataSource);
|
||||||
|
// });
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => unref(propsRef).dataSource,
|
||||||
|
() => {
|
||||||
const { dataSource, api } = unref(propsRef);
|
const { dataSource, api } = unref(propsRef);
|
||||||
!api && dataSource && (dataSourceRef.value = dataSource);
|
!api && dataSource && (dataSourceRef.value = dataSource);
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function handleTableChange(
|
function handleTableChange(
|
||||||
pagination: PaginationProps,
|
pagination: PaginationProps,
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
import { ref, ComputedRef, unref, computed, watchEffect } from 'vue';
|
import { ref, ComputedRef, unref, computed, watch } from 'vue';
|
||||||
import type { BasicTableProps } from '../types/table';
|
import type { BasicTableProps } from '../types/table';
|
||||||
|
|
||||||
export function useLoading(props: ComputedRef<BasicTableProps>) {
|
export function useLoading(props: ComputedRef<BasicTableProps>) {
|
||||||
const loadingRef = ref(unref(props).loading);
|
const loadingRef = ref(unref(props).loading);
|
||||||
|
|
||||||
watchEffect(() => {
|
watch(
|
||||||
loadingRef.value = unref(props).loading;
|
() => unref(props).loading,
|
||||||
});
|
(loading) => {
|
||||||
|
loadingRef.value = loading;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const getLoading = computed(() => {
|
const getLoading = computed(() => {
|
||||||
return unref(loadingRef);
|
return unref(loadingRef);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import type { BasicTableProps, TableRowSelection } from '../types/table';
|
import type { BasicTableProps, TableRowSelection } from '../types/table';
|
||||||
import type { Ref, ComputedRef } from 'vue';
|
import type { Ref, ComputedRef } from 'vue';
|
||||||
import { computed, unref, ref, nextTick, watchEffect } from 'vue';
|
import { computed, unref, ref, nextTick, watch } from 'vue';
|
||||||
|
|
||||||
import { getViewportOffset } from '/@/utils/domUtils';
|
import { getViewportOffset } from '/@/utils/domUtils';
|
||||||
import { isBoolean } from '/@/utils/is';
|
import { isBoolean } from '/@/utils/is';
|
||||||
@@ -28,9 +28,15 @@ export function useTableScroll(
|
|||||||
return canResize && !(scroll || {}).y;
|
return canResize && !(scroll || {}).y;
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watch(
|
||||||
unref(getCanResize) && debounceRedoHeight();
|
() => unref(getCanResize),
|
||||||
});
|
() => {
|
||||||
|
debounceRedoHeight();
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function redoHeight() {
|
function redoHeight() {
|
||||||
if (unref(getCanResize)) {
|
if (unref(getCanResize)) {
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
getShowInsetHeaderRef,
|
getShowInsetHeaderRef,
|
||||||
getShowFullHeaderRef,
|
getShowFullHeaderRef,
|
||||||
getHeaderTheme,
|
getHeaderTheme,
|
||||||
|
getShowHeader,
|
||||||
} = useHeaderSetting();
|
} = useHeaderSetting();
|
||||||
|
|
||||||
const { getFullContent } = useFullContent();
|
const { getFullContent } = useFullContent();
|
||||||
@@ -68,7 +69,7 @@
|
|||||||
const getPlaceholderDomStyle = computed(
|
const getPlaceholderDomStyle = computed(
|
||||||
(): CSSProperties => {
|
(): CSSProperties => {
|
||||||
let height = 0;
|
let height = 0;
|
||||||
if (unref(getShowFullHeaderRef) || !unref(getSplit)) {
|
if ((unref(getShowFullHeaderRef) || !unref(getSplit)) && unref(getShowHeader)) {
|
||||||
height += HEADER_HEIGHT;
|
height += HEADER_HEIGHT;
|
||||||
}
|
}
|
||||||
if (unref(getShowMultipleTab)) {
|
if (unref(getShowMultipleTab)) {
|
||||||
|
@@ -129,6 +129,7 @@ export function useTabDropdown(tabContentProps: TabContentProps) {
|
|||||||
const isScale = !unref(getShowMenu) && !unref(getShowHeader);
|
const isScale = !unref(getShowMenu) && !unref(getShowHeader);
|
||||||
setMenuSetting({
|
setMenuSetting({
|
||||||
show: isScale,
|
show: isScale,
|
||||||
|
hidden: !isScale,
|
||||||
});
|
});
|
||||||
setHeaderSetting({
|
setHeaderSetting({
|
||||||
show: isScale,
|
show: isScale,
|
||||||
|
Reference in New Issue
Block a user