Browse Source

style: format vxe toolbar regression changes

pull/8335/head
kilisamemarisaaa 4 weeks ago
parent
commit
a0bfae8731
  1. 25
      packages/effects/plugins/src/vxe-table/__tests__/use-vxe-grid.reactivity.test.ts
  2. 4
      packages/effects/plugins/src/vxe-table/use-vxe-grid.vue

25
packages/effects/plugins/src/vxe-table/__tests__/use-vxe-grid.reactivity.test.ts

@ -52,7 +52,11 @@ vi.mock('@vben/locales', () => ({ $t: (key: string) => key }));
vi.mock('@vben-core/shadcn-ui', async () => {
const { defineComponent, h } = await import('vue');
const Stub = defineComponent((_, { slots }) => () => h('div', slots.default?.()));
const Stub = defineComponent(
(_, { slots }) =>
() =>
h('div', slots.default?.()),
);
return { VbenHelpTooltip: Stub, VbenLoading: Stub };
});
@ -121,15 +125,16 @@ describe('vben vxe grid toolbar slots', () => {
unmount: vi.fn(),
useStore: vi.fn(() => ({})),
};
const Consumer = defineComponent(() => () =>
h(VbenVxeGrid, { api } as any, {
[slotName]: () =>
h(
'span',
{ 'data-slot-state': '' },
loading.value ? 'loading' : 'idle',
),
}),
const Consumer = defineComponent(
() => () =>
h(VbenVxeGrid, { api } as any, {
[slotName]: () =>
h(
'span',
{ 'data-slot-state': '' },
loading.value ? 'loading' : 'idle',
),
}),
);
const host = document.createElement('div');
document.body.append(host);

4
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue

@ -157,9 +157,7 @@ const showTableTitle = computed(() => {
const showToolbar = computed(() => {
return (
!!slots[TOOLBAR_ACTIONS] ||
!!slots[TOOLBAR_TOOLS] ||
showTableTitle.value
!!slots[TOOLBAR_ACTIONS] || !!slots[TOOLBAR_TOOLS] || showTableTitle.value
);
});

Loading…
Cancel
Save