fix menu-config.enabled 修改导致报错问题 #2509
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# vxe-table
|
||||
|
||||
[简体中文](README.md) | [繁體中文](README.zh-TW.md) | English
|
||||
[简体中文](README.md) | [繁體中文](README.zh-TW.md) | English | [日本語](README.ja-JP.md)
|
||||
|
||||
[](https://gitee.com/xuliangzhan_admin/vxe-table/stargazers)
|
||||
[](https://www.npmjs.com/package/vxe-table)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# vxe-table
|
||||
|
||||
[简体中文](README.md) | 繁體中文 | [English](README.en.md)
|
||||
[简体中文](README.md) | 繁體中文 | [English](README.en.md) | [日本語](README.ja-JP.md)
|
||||
|
||||
[](https://gitee.com/xuliangzhan_admin/vxe-table/stargazers)
|
||||
[](https://www.npmjs.com/package/vxe-table)
|
||||
@@ -59,8 +59,8 @@ Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
|
||||
* [x] 虛擬滾動
|
||||
* [x] 虛擬合併
|
||||
* [x] CSS 變量主題
|
||||
* [x] (([企業版](https://vxetable.cn/pluginDocs/))) 儲存格區域選取
|
||||
* [x] (([企業版](https://vxetable.cn/pluginDocs/))) 儲存格複製/粘貼
|
||||
* [x] ([企業版](https://vxetable.cn/pluginDocs/)) 儲存格區域選取
|
||||
* [x] ([企業版](https://vxetable.cn/pluginDocs/)) 儲存格複製/粘貼
|
||||
* [x] ([企業版](https://vxetable.cn/pluginDocs/)) 儲存格查找和替換
|
||||
* [x] ([企業版](https://vxetable.cn/pluginDocs/)) 全鍵盤操作
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"style": "lib/style.css",
|
||||
"typings": "types/index.d.ts",
|
||||
"dependencies": {
|
||||
"vxe-pc-ui": "^4.0.88"
|
||||
"vxe-pc-ui": "^4.0.91"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/resize-observer-browser": "^0.1.11",
|
||||
|
||||
@@ -19,7 +19,7 @@ export default defineComponent({
|
||||
refElem
|
||||
}
|
||||
|
||||
const $xemenupanel: any = {
|
||||
const $xeMenuPanel: any = {
|
||||
xID,
|
||||
props,
|
||||
context,
|
||||
@@ -123,9 +123,9 @@ export default defineComponent({
|
||||
])
|
||||
}
|
||||
|
||||
$xemenupanel.renderVN = renderVN
|
||||
$xeMenuPanel.renderVN = renderVN
|
||||
|
||||
return $xemenupanel
|
||||
return $xeMenuPanel
|
||||
},
|
||||
render () {
|
||||
return this.renderVN()
|
||||
|
||||
@@ -7,7 +7,7 @@ const { getConfig } = VxeUI
|
||||
|
||||
export default {
|
||||
/** 基本属性 */
|
||||
id: String as PropType<VxeTablePropTypes.ID>,
|
||||
id: [String, Function] as PropType<VxeTablePropTypes.ID>,
|
||||
// 数据
|
||||
data: Array as PropType<any[]>,
|
||||
// 表格的高度
|
||||
|
||||
@@ -363,6 +363,17 @@ export default defineComponent({
|
||||
const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
|
||||
let $xeToolbar: VxeToolbarConstructor
|
||||
|
||||
const computeTableId = computed(() => {
|
||||
const { id } = props
|
||||
if (id) {
|
||||
if (XEUtils.isFunction(id)) {
|
||||
return `${id({ $table: $xeTable, $grid: $xeGrid }) || ''}`
|
||||
}
|
||||
return `${id}`
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
const computeValidOpts = computed(() => {
|
||||
return Object.assign({}, getConfig().table.validConfig, props.validConfig) as VxeTablePropTypes.ValidOpts
|
||||
})
|
||||
@@ -622,6 +633,7 @@ export default defineComponent({
|
||||
|
||||
const computeMaps: VxeTablePrivateComputed = {
|
||||
computeSize,
|
||||
computeTableId,
|
||||
computeValidOpts,
|
||||
computeSXOpts,
|
||||
computeSYOpts,
|
||||
@@ -943,7 +955,8 @@ export default defineComponent({
|
||||
* 还原自定义列操作状态
|
||||
*/
|
||||
const restoreCustomStorage = () => {
|
||||
const { id, customConfig } = props
|
||||
const { customConfig } = props
|
||||
const tableId = computeTableId.value
|
||||
const customOpts = computeCustomOpts.value
|
||||
const { storage, restoreStore } = customOpts
|
||||
const isAllCustom = storage === true
|
||||
@@ -953,14 +966,14 @@ export default defineComponent({
|
||||
const isCustomFixed = isAllCustom || storageOpts.fixed
|
||||
const isCustomSort = isAllCustom || storageOpts.sort
|
||||
if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
||||
if (!id) {
|
||||
if (!tableId) {
|
||||
errLog('vxe.error.reqProp', ['id'])
|
||||
return
|
||||
}
|
||||
const storeData: VxeTableDefines.CustomStoreData = getCustomStorageMap(id)
|
||||
const storeData: VxeTableDefines.CustomStoreData = getCustomStorageMap(tableId)
|
||||
if (restoreStore) {
|
||||
return Promise.resolve(
|
||||
restoreStore({ id, type: 'restore', storeData })
|
||||
restoreStore({ id: tableId, type: 'restore', storeData })
|
||||
).then(storeData => {
|
||||
if (!storeData) {
|
||||
return
|
||||
@@ -4823,9 +4836,9 @@ export default defineComponent({
|
||||
$xeTable.clearSelected()
|
||||
}
|
||||
if (areaOpts.autoClear) {
|
||||
if ($xeTable.clearCellAreas) {
|
||||
if ($xeTable.getCellAreas) {
|
||||
const cellAreas = $xeTable.getCellAreas()
|
||||
if (cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
|
||||
if (cellAreas && cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
|
||||
tablePrivateMethods.preventEvent(evnt, 'event.clearAreas', {}, () => {
|
||||
$xeTable.clearCellAreas()
|
||||
$xeTable.clearCopyCellArea()
|
||||
@@ -5503,7 +5516,7 @@ export default defineComponent({
|
||||
Object.assign(reactData.columnStore, { resizeList, pxList, pxMinList, scaleList, scaleMinList, autoList, remainList })
|
||||
},
|
||||
saveCustomStore (type) {
|
||||
const { id } = props
|
||||
const tableId = computeTableId.value
|
||||
const customOpts = computeCustomOpts.value
|
||||
const { updateStore, storage } = customOpts
|
||||
const isAllCustom = storage === true
|
||||
@@ -5513,7 +5526,7 @@ export default defineComponent({
|
||||
const isCustomFixed = isAllCustom || storageOpts.fixed
|
||||
const isCustomSort = isAllCustom || storageOpts.sort
|
||||
if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
|
||||
if (!id) {
|
||||
if (!tableId) {
|
||||
errLog('vxe.error.reqProp', ['id'])
|
||||
return nextTick()
|
||||
}
|
||||
@@ -5527,12 +5540,12 @@ export default defineComponent({
|
||||
: tableMethods.getCustomStoreData()
|
||||
if (updateStore) {
|
||||
return updateStore({
|
||||
id,
|
||||
id: tableId,
|
||||
type,
|
||||
storeData
|
||||
})
|
||||
} else {
|
||||
setCustomStorageMap(id, type === 'reset' ? null : storeData)
|
||||
setCustomStorageMap(tableId, type === 'reset' ? null : storeData)
|
||||
}
|
||||
}
|
||||
return nextTick()
|
||||
@@ -7093,34 +7106,37 @@ export default defineComponent({
|
||||
})
|
||||
: createCommentVNode(),
|
||||
/**
|
||||
* 通用提示
|
||||
* 提示相关
|
||||
*/
|
||||
VxeUITooltipComponent
|
||||
? h(VxeUITooltipComponent, {
|
||||
ref: refCommTooltip,
|
||||
isArrow: false,
|
||||
enterable: false
|
||||
})
|
||||
: createCommentVNode(),
|
||||
/**
|
||||
* 工具提示
|
||||
*/
|
||||
VxeUITooltipComponent
|
||||
? h(VxeUITooltipComponent, Object.assign({
|
||||
ref: refTooltip
|
||||
}, tipConfig, tooltipStore.currOpts))
|
||||
: createCommentVNode(),
|
||||
/**
|
||||
* 校验提示
|
||||
*/
|
||||
VxeUITooltipComponent && props.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
|
||||
? h(VxeUITooltipComponent, {
|
||||
ref: refValidTooltip,
|
||||
class: [{
|
||||
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
||||
}, 'vxe-table--valid-error'],
|
||||
...(validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : {}) as any
|
||||
})
|
||||
? h('div', {}, [
|
||||
/**
|
||||
* 通用提示
|
||||
*/
|
||||
h(VxeUITooltipComponent, {
|
||||
ref: refCommTooltip,
|
||||
isArrow: false,
|
||||
enterable: false
|
||||
}),
|
||||
/**
|
||||
* 工具提示
|
||||
*/
|
||||
h(VxeUITooltipComponent, Object.assign({
|
||||
ref: refTooltip
|
||||
}, tipConfig, tooltipStore.currOpts)),
|
||||
/**
|
||||
* 校验提示
|
||||
*/
|
||||
props.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
|
||||
? h(VxeUITooltipComponent, {
|
||||
ref: refValidTooltip,
|
||||
class: [{
|
||||
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
||||
}, 'vxe-table--valid-error'],
|
||||
...(validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : {}) as any
|
||||
})
|
||||
: createCommentVNode()
|
||||
])
|
||||
: createCommentVNode()
|
||||
])
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import './old-icon.scss';
|
||||
|
||||
@font-face {
|
||||
font-family: "vxetableiconfont";
|
||||
src:
|
||||
|
||||
Reference in New Issue
Block a user