Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(src/server/render.js): Fixes component directives rendering #11287

Closed

Conversation

trecenti
Copy link

@trecenti trecenti commented Apr 6, 2020

fix #10733

SSR render does not execute directives attached to a component, this is happening because during SSR render we're using the component's root element as a source for rendering, thus there's no directive associated with it.

This fixes it by copying directives from the Component declaration to the Component's root element, while rendering the root element it references the Component instance vnode to properly render it's modules applying the directives.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

Component directives are not being render during SSR, this fixes it by passing the directives data
to its first imediate child.

fix vuejs#10733
@tylerforesthauser
Copy link

Is there an explicit reason this fix hasn't yet been implemented?

@trecenti
Copy link
Author

trecenti commented Mar 1, 2021

I'm closing this should you still need this change LMK and I can re-open it.

@trecenti trecenti closed this Mar 1, 2021
@manniL
Copy link
Contributor

manniL commented Jun 8, 2021

Please reopen! 🙏🏻

@buffalom
Copy link

buffalom commented Jan 6, 2022

This still seems to be an issue, if I am not mistaken. Is there a reason why this has been closed?

@drewbaker
Copy link

I really need this fixed @trecenti. We use a custom directive to animate a parallax effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vue-server-renderer: directive not applied to imported component
5 participants