Subscribe on changes!

当组件中包含多个根标签时,组件上设置 class,通过 $attrs.class 指定单个标签,样式不生效

avatar
Jul 19th 2022

Vue version

3.2.37

Link to minimal reproduction

Here is Hello world component

I am fact title

Steps to reproduce

  1. I have a component. image
  2. The component have two element image
  3. I set a class at image image
  4. however, over style don't take ffect although the class name('hello_word_width') was added to the div. image

What is expected?

The class name not only be added to defind that element in multiple root elements, but also its style can take effect from parent component.

What is actually happening?

its style don't take effect.

System Info

windows
chrome

Any additional comments?

No response

avatar
Jul 19th 2022

Please provide a runnable reproduction with our SFC playground and create a new issue. Thank you.