Skip to content

Commit a7c9380

Browse files
committed
feat: enhance custom action slot options to include ref in render function
1 parent 85b9775 commit a7c9380

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/stores/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ export const useAppStore = defineStore('app', () => {
4747
componentProps?: Recordable
4848
componentSlots?: Recordable
4949
}
50+
interface CustomActionSlotOptions {
51+
h: typeof h
52+
ref: typeof ref
53+
}
5054
type CustomActionSlot =
51-
| (({ h }: any) => VNode | string | number | boolean)
55+
| ((options: CustomActionSlotOptions) => VNode | string | number | boolean)
5256
| VNode
5357
| string
5458
| number
@@ -69,7 +73,7 @@ export const useAppStore = defineStore('app', () => {
6973
let result: CustomActionSlot = slot
7074
if (typeof result === 'function') {
7175
const customH = (type: any, ...args: any[]) => h(resolveComponent(type), ...args)
72-
result = result({ h: customH })
76+
result = result({ h: customH, ref })
7377
}
7478
if (isVNode(result)) {
7579
return result

0 commit comments

Comments
 (0)