Browse Source

fix(@vben/playground): drop non-null assertion in CellOperation renderer

Co-authored-by: Cursor <cursoragent@cursor.com>
pull/8382/head
Zehui Chan 3 weeks ago
parent
commit
51757106fd
  1. 17
      playground/src/adapter/vxe-table.ts

17
playground/src/adapter/vxe-table.ts

@ -310,7 +310,7 @@ setupVbenVxeTable({
); );
} }
const operationRenderStrategies: Recordable<() => any[]> = { const operationRenderStrategies = {
button: () => btns, button: () => btns,
menu: () => [ menu: () => [
h( h(
@ -318,9 +318,7 @@ setupVbenVxeTable({
{ {
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
placement: placement:
column.align === 'left' column.align === 'left' ? 'bottomLeft' : 'bottomRight',
? 'bottomLeft'
: 'bottomRight',
trigger: ['click'], trigger: ['click'],
...dropdownProps, ...dropdownProps,
}, },
@ -338,11 +336,9 @@ setupVbenVxeTable({
h( h(
'div', 'div',
{ {
class: class: 'ant-dropdown-menu flex flex-col gap-1 p-1',
'ant-dropdown-menu flex flex-col gap-1 p-1',
onClick: (event: MouseEvent) => onClick: (event: MouseEvent) => event.stopPropagation(),
event.stopPropagation(),
style: { style: {
minWidth: '80px', minWidth: '80px',
@ -355,8 +351,9 @@ setupVbenVxeTable({
], ],
}; };
const renderOperations = const renderOperations =
operationRenderStrategies[renderMode ?? mode] ?? (renderMode ?? mode) === 'menu'
operationRenderStrategies.button!; ? operationRenderStrategies.menu
: operationRenderStrategies.button;
return h( return h(
'div', 'div',

Loading…
Cancel
Save