-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
:style on a custom component does not generate code using vue-server-renderer #4055
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
Comments
I think this should be considered as a bug, it causes inconsistence between client side render and server side render. I am looking into it. AS for props not declared in child component, this is an undocumented behavior, we should document it clearly. |
Hi, There is no problem with the compiler. I print both render functions' text. They are the same. The problem is, at runtime, every instance will have an But at server rendering, the render function It's quite hard to fix.... What about in renderStyle, inspect the parent node, if the parent node has |
Uh oh!
There was an error while loading. Please reload this page.
Vue.js version
2.0.3
Reproduction Link
http://jsfiddle.net/jason_sanjose/0aat08kh/1/
Steps to reproduce
parent
andchild
. Inparent
's template, usechild
with inline styles<child :style="styleComputed"></child>
What is Expected?
Inline styles should work consistently for browser and server environments.
What is actually happening?
Server does not render
:style
attribute onchild
As a workaround, in the
child
template, I've added:style
to the root element and passed down a style as a prop, e.g.It's not obvious from the docs if
<child :style="styleComputed"/>
is valid code. I suppose an argument could be made that only custom properties defined inchild
should be accepted?The text was updated successfully, but these errors were encountered: