fix(grid): [grid] fix context menu Display abnormality

This commit is contained in:
zzcr 2023-11-22 23:14:45 -08:00
parent e8a3a66747
commit 65e089f53d
No known key found for this signature in database
GPG Key ID: F6C4DFD2EF53A673
1 changed files with 29 additions and 31 deletions

View File

@ -42,45 +42,43 @@ export default {
return h(
'ul',
{
style: { left: '-9999999px' },
class: ['tiny-grid-menu__clild-wrapper', { show }]
},
item.children.map((child, cIndex) =>
// prettier-ignore
child.visible === false
? [null]
: h(
'li',
{
class: { 'link__disabled': child.disabled, 'link__active': child === ctxMenuStore.selectChild },
key: `${gIndex}_${index}_${cIndex}`
},
[
h(
'a',
{
class: `tiny-grid-menu__link ${toKebab(item.code)}`,
on: {
click(event) {
tableInstance.ctxMenuLinkEvent(event, child)
},
mouseover(event) {
tableInstance.ctxMenuMouseoverEvent(event, item, child)
},
mouseout(event) {
if (!getEventTargetNode(event, document.body, toKebab(item.code)).flag) {
tableInstance.ctxMenuMouseoutEvent(event, item, child)
'li',
{
class: { 'link__disabled': child.disabled, 'link__active': child === ctxMenuStore.selectChild },
key: `${gIndex}_${index}_${cIndex}`
},
[
h(
'a',
{
class: `tiny-grid-menu__link ${toKebab(item.code)}`,
on: {
click(event) {
tableInstance.ctxMenuLinkEvent(event, child)
},
mouseover(event) {
tableInstance.ctxMenuMouseoverEvent(event, item, child)
},
mouseout(event) {
if (!getEventTargetNode(event, document.body, toKebab(item.code)).flag) {
tableInstance.ctxMenuMouseoutEvent(event, item, child)
}
}
}
}
},
[
child.prefixIcon ? h(child.prefixIcon, { class: 'tiny-grid-menu__link-prefix' }) : [null],
h('span', { class: 'tiny-grid-menu__link-content' }, getFuncText(child.name))
]
)
]
)
},
[
child.prefixIcon ? h(child.prefixIcon, { class: 'tiny-grid-menu__link-prefix' }) : [null],
h('span', { class: 'tiny-grid-menu__link-content' }, getFuncText(child.name))
]
)
]
)
)
)
},