mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 00:26:20 +08:00
perf(table): remove ExpandIcon
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
// TODO
|
|
||||||
import type { GetManualChunk } from 'rollup';
|
|
||||||
|
|
||||||
//
|
|
||||||
const vendorLibs: { match: string[]; output: string }[] = [
|
|
||||||
// {
|
|
||||||
// match: ['xlsx'],
|
|
||||||
// output: 'xlsx',
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
export const configManualChunk: GetManualChunk = (id: string) => {
|
|
||||||
if (/[\\/]node_modules[\\/]/.test(id)) {
|
|
||||||
const matchItem = vendorLibs.find((item) => {
|
|
||||||
const reg = new RegExp(`[\\/]node_modules[\\/]_?(${item.match.join('|')})(.*)`, 'ig');
|
|
||||||
return reg.test(id);
|
|
||||||
});
|
|
||||||
return matchItem ? matchItem.output : null;
|
|
||||||
}
|
|
||||||
};
|
|
@@ -1,25 +0,0 @@
|
|||||||
import type { Plugin } from 'vite';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO
|
|
||||||
* Temporarily solve the Vite circular dependency problem, and wait for a better solution to fix it later. I don't know what problems this writing will bring.
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
|
|
||||||
export function configHmrPlugin(): Plugin {
|
|
||||||
return {
|
|
||||||
name: 'singleHMR',
|
|
||||||
// handleHotUpdate({ modules, file }) {
|
|
||||||
// if (file.match(/xml$/)) return [];
|
|
||||||
|
|
||||||
// modules.forEach((m) => {
|
|
||||||
// if (!m.url.match(/\.(css|less)/)) {
|
|
||||||
// m.importedModules = new Set();
|
|
||||||
// m.importers = new Set();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// return modules;
|
|
||||||
// },
|
|
||||||
};
|
|
||||||
}
|
|
@@ -43,7 +43,6 @@
|
|||||||
import { Table } from 'ant-design-vue';
|
import { Table } from 'ant-design-vue';
|
||||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||||
import { PageWrapperFixedHeightKey } from '/@/components/Page';
|
import { PageWrapperFixedHeightKey } from '/@/components/Page';
|
||||||
import expandIcon from './components/ExpandIcon';
|
|
||||||
import HeaderCell from './components/HeaderCell.vue';
|
import HeaderCell from './components/HeaderCell.vue';
|
||||||
import { InnerHandlers } from './types/table';
|
import { InnerHandlers } from './types/table';
|
||||||
|
|
||||||
@@ -222,10 +221,8 @@
|
|||||||
const getBindValues = computed(() => {
|
const getBindValues = computed(() => {
|
||||||
const dataSource = unref(getDataSourceRef);
|
const dataSource = unref(getDataSourceRef);
|
||||||
let propsData: Recordable = {
|
let propsData: Recordable = {
|
||||||
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
|
|
||||||
...attrs,
|
...attrs,
|
||||||
customRow,
|
customRow,
|
||||||
expandIcon: slots.expandIcon ? null : expandIcon(),
|
|
||||||
...unref(getProps),
|
...unref(getProps),
|
||||||
...unref(getHeaderProps),
|
...unref(getHeaderProps),
|
||||||
scroll: unref(getScrollRef),
|
scroll: unref(getScrollRef),
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
import { BasicArrow } from '/@/components/Basic';
|
|
||||||
|
|
||||||
export default () => {
|
|
||||||
return (props: Recordable) => {
|
|
||||||
if (!props.expandable) {
|
|
||||||
if (props.needIndentSpaced) {
|
|
||||||
return <span class="ant-table-row-expand-icon ant-table-row-spaced" />;
|
|
||||||
} else {
|
|
||||||
return <span />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<BasicArrow
|
|
||||||
style="margin-right: 8px"
|
|
||||||
iconStyle="margin-top: -2px;"
|
|
||||||
onClick={(e: Event) => {
|
|
||||||
props.onExpand(props.record, e);
|
|
||||||
}}
|
|
||||||
expand={props.expanded}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
@@ -21,11 +21,8 @@ export function useRowSelection(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
selectedRowKeys: unref(selectedRowKeysRef),
|
selectedRowKeys: unref(selectedRowKeysRef),
|
||||||
hideDefaultSelections: false,
|
|
||||||
onChange: (selectedRowKeys: string[]) => {
|
onChange: (selectedRowKeys: string[]) => {
|
||||||
setSelectedRowKeys(selectedRowKeys);
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
// selectedRowKeysRef.value = selectedRowKeys;
|
|
||||||
// selectedRowRef.value = selectedRows;
|
|
||||||
},
|
},
|
||||||
...omit(rowSelection, ['onChange']),
|
...omit(rowSelection, ['onChange']),
|
||||||
};
|
};
|
||||||
|
@@ -10,6 +10,7 @@ import type {
|
|||||||
SizeType,
|
SizeType,
|
||||||
} from './types/table';
|
} from './types/table';
|
||||||
import type { FormProps } from '/@/components/Form';
|
import type { FormProps } from '/@/components/Form';
|
||||||
|
|
||||||
import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const';
|
import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
watch,
|
watch,
|
||||||
onMounted,
|
onMounted,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
import TreeHeader from './TreeHeader.vue';
|
||||||
import { Tree, Empty } from 'ant-design-vue';
|
import { Tree, Empty } from 'ant-design-vue';
|
||||||
import { TreeIcon } from './TreeIcon';
|
import { TreeIcon } from './TreeIcon';
|
||||||
import { ScrollContainer } from '/@/components/Container';
|
import { ScrollContainer } from '/@/components/Container';
|
||||||
@@ -23,7 +24,6 @@
|
|||||||
import { useTree } from './useTree';
|
import { useTree } from './useTree';
|
||||||
import { useContextMenu } from '/@/hooks/web/useContextMenu';
|
import { useContextMenu } from '/@/hooks/web/useContextMenu';
|
||||||
import { CreateContextOptions } from '/@/components/ContextMenu';
|
import { CreateContextOptions } from '/@/components/ContextMenu';
|
||||||
import TreeHeader from './TreeHeader.vue';
|
|
||||||
import { treeEmits, treeProps } from './tree';
|
import { treeEmits, treeProps } from './tree';
|
||||||
import { createBEM } from '/@/utils/bem';
|
import { createBEM } from '/@/utils/bem';
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
{{ title }}
|
{{ title }}
|
||||||
</BasicTitle>
|
</BasicTitle>
|
||||||
<div
|
<div
|
||||||
class="flex flex-1 justify-self-stretch items-center cursor-pointer"
|
class="flex items-center flex-1 cursor-pointer justify-self-stretch"
|
||||||
v-if="search || toolbar"
|
v-if="search || toolbar"
|
||||||
>
|
>
|
||||||
<div :class="getInputSearchCls" v-if="search">
|
<div :class="getInputSearchCls" v-if="search">
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
const [bem] = createBEM('tree-header');
|
const [bem] = createBEM('tree-header');
|
||||||
|
|
||||||
// eslint-disable vue/valid-define-emits
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
helpMessage: {
|
helpMessage: {
|
||||||
type: [String, Array] as PropType<string | string[]>,
|
type: [String, Array] as PropType<string | string[]>,
|
||||||
|
Reference in New Issue
Block a user