Skip to content

How to access vnode on getSSRProps (working with directives)? #12861

Discussion options

You must be logged in to vote

When rendering a template for SSR, Vue generates an HTML string directly, it doesn't create any VNodes.

The lack of VNode is mentioned (albeit briefly) in the documentation for getSSRProps at https://vuejs.org/guide/scaling-up/ssr.html#custom-directives. Note this comment:

// getSSRProps only receives the directive binding.

You can see the relevant source code here:

dir.getSSRProps(
{
dir,
instance: ssrUtils.getComponentPublicInstance(instance.$),
value,
oldValue: undefined,
arg,
modifiers,
},
null as any,
) || {}

You can see mor…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ozzyfromspace
Comment options

Answer selected by ozzyfromspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants