Vue: Class is not applied to component extending abstract component

Created on 11 Jan 2017  ·  3Comments  ·  Source: vuejs/vue

Vue.js version

2.1.8

Reproduction Link

Codepen

outer class is not applied to a component`s $el node.
Try to comment absract: true line and you will see that class is applying.

What is Expected?

Outer class must be applied to the root component element.

What is actually happening?

Outer class is not applied if the component extends a base component with abstract flag.

Most helpful comment

Any plan to include abstract components in the doc?

All 3 comments

Extending an abstract component, the component test becomes abstract too. IMO abstract components can have only bindings/attributes defined in props.

Abstract components are not designed to render templates of their own - they are like "decorators" that simply wrap other components/elements via composition. e.g. <transition>:

<transition>
  <component></component>
</transition>

So abstract components do not have DOM elements of its own - it simply enhances its slot children. Extending an abstract component and give it some concrete DOM doesn't make sense.

Also, abstract mode is not publicly documented and may change without notice, you should avoid using it unless you are really sure you know what you are doing ;)

Any plan to include abstract components in the doc?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aviggngyv picture aviggngyv  ·  3Comments

franciscolourenco picture franciscolourenco  ·  3Comments

guan6 picture guan6  ·  3Comments

bdedardel picture bdedardel  ·  3Comments

seemsindie picture seemsindie  ·  3Comments