[Vuejs]-Buefy table not passing props in render function

0👍

After taking a look at the type definitions for createElement function I discovered you can pass a function to it:

export type ScopedSlot = (props: any) => ScopedSlotReturnValue;

export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined;


export interface CreateElement {
  (tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), children?: VNodeChildren): VNode;
  (tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), data?: VNodeData, children?: VNodeChildren): VNode;
}


This can be solved with:

h(BTable, {...}, [
  (rowProps) => h('div', {}, context.slots.default(rowProps))
])

Leave a comment