Skip to content

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

@PowerfulPony

Description

@PowerfulPony

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions