mirror of https://github.com/vuejs/core.git
27 lines
558 B
TypeScript
27 lines
558 B
TypeScript
|
import type { ComponentPublicInstance, Directive } from '@vue/runtime-core'
|
||
|
|
||
|
export function ssrGetDirectiveProps(
|
||
|
instance: ComponentPublicInstance,
|
||
|
dir: Directive,
|
||
|
value?: any,
|
||
|
arg?: string,
|
||
|
modifiers: Record<string, boolean> = {},
|
||
|
): Record<string, any> {
|
||
|
if (typeof dir !== 'function' && dir.getSSRProps) {
|
||
|
return (
|
||
|
dir.getSSRProps(
|
||
|
{
|
||
|
dir,
|
||
|
instance,
|
||
|
value,
|
||
|
oldValue: undefined,
|
||
|
arg,
|
||
|
modifiers,
|
||
|
},
|
||
|
null as any,
|
||
|
) || {}
|
||
|
)
|
||
|
}
|
||
|
return {}
|
||
|
}
|