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

Using SSR with defined dynamic components, not rendered classes at tag (component) #4143

Closed
PowerfulPony opened this issue Nov 7, 2016 · 4 comments · Fixed by #4146
Closed

Comments

@PowerfulPony
Copy link
Contributor

Vue.js version

2.0.2

Steps to reproduce

  1. Create component
Vue.component('testcomponent', {
  render: h => h('div', 'contain')
})
  1. Use the components within the parent component template with className
  <div id="appcomponent">
    <testcomponent class="testclass" />
  </div>

What is Expected?

Expected to render on the server side

  <div id="appcomponent">
    <div class="testclass">contain</div>
  </div>

Similarly, as the client-side

What is actually happening?

The server side is not renders classes in dynamically generated components

  <div id="appcomponent">
    <div>contain</div>
  </div>

At the same time, the client side, renders everything with classes

  <div id="appcomponent">
    <div class="testclass">contain</div>
  </div>

This behavior causes a twitch of the interface, due to the belated addition of classes with styles.
Also incorrect display if the js file not to load on slow internet.

@LinusBorg
Copy link
Member

Hello @PowerfulPony,

thank you for your filing this issue.

Please follow the guidelines on how to report an issue. In particular, provide an example on www.jsfiddle.net (or a similar service) that reproduces the problem.

Thank you.

@PowerfulPony
Copy link
Contributor Author

Hi @LinusBorg,
I do not understand how you can demonstrate through the server render jsfiddle.

@LinusBorg
Copy link
Member

In this case, a repository would be the better option, oviously.

@defcc
Copy link
Member

defcc commented Nov 7, 2016

As @LinusBorg said, it would be better to provide a repository for this case. Seems to be a bug, similar to #4076

@defcc defcc added the bug label Nov 7, 2016
yyx990803 pushed a commit that referenced this issue Nov 7, 2016
* fix ssr class render

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

Successfully merging a pull request may close this issue.

3 participants