1
0
mirror of synced 2025-12-10 07:58:13 +08:00

优化树渲染

This commit is contained in:
xuliangzhan
2023-08-01 00:01:13 +08:00
parent d9e03e5a6b
commit 036bb5a9e9
18 changed files with 374 additions and 144 deletions

View File

@@ -1,8 +1,8 @@
import { VXETableGlobalConfig } from '../../../types/all'
import { VXETableConfigOptions } from '../../../types/all'
const iconPrefix = 'vxe-icon-'
const GlobalConfig: VXETableGlobalConfig = {
const GlobalConfig: VXETableConfigOptions = {
size: null, // 全局尺寸
zIndex: 999, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
@@ -78,9 +78,9 @@ const GlobalConfig: VXETableGlobalConfig = {
treeConfig: {
rowField: 'id',
parentField: 'parentId',
children: 'children',
hasChild: 'hasChild',
mapChildren: '_X_ROW_CHILD',
childrenField: 'children',
hasChildField: 'hasChild',
mapChildrenField: '_X_ROW_CHILD',
indent: 20,
showIcon: true
},
@@ -371,4 +371,4 @@ const GlobalConfig: VXETableGlobalConfig = {
i18n: (key: string) => key
}
export default GlobalConfig
export default GlobalConfig as Required<VXETableConfigOptions>

View File

@@ -26,9 +26,9 @@ class VXEFormatsStore {
// 兼容
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
if (XEUtils.isFunction(render)) {
warnLog('vxe.error.delProp', ['callback', 'formatMethod'])
warnLog('vxe.error.delProp', ['callback', 'cellFormatMethod'])
render = {
formatMethod: render
cellFormatMethod: render
}
}
}

View File

@@ -1,11 +1,11 @@
import GlobalConfig from './conf'
import XEUtils from 'xe-utils'
import { VxeGlobalSetup } from '../../../types/all'
import { VxeGlobalConfigMethod } from '../../../types/all'
/**
* 全局参数设置
*/
export const setup: VxeGlobalSetup = (options) => {
export const setup: VxeGlobalConfigMethod = (options) => {
return XEUtils.merge(GlobalConfig, options)
}