Subscribe on changes!

[Vue SSR]: Scoped data attributes aren't passed down to functional components

avatar
Apr 27th 2022

Version

3.2.25

Reproduction link

stackblitz.com

Steps to reproduce

Create a component with a scoped style (parent) Create a regular component with a template tag (children) Create a functional component that uses h (children)

The regular children inherit the data attribute from the parent The functional children doesn't inherit the data attribute from the parent.

What is expected?

The child functional component should receive the data attributes as if it were a template component

What is actually happening?

Functional and Regular component behaves differently in this instance :

image
avatar
Apr 28th 2022

Version

3.2.25

Reproduction link

stackblitz.com

Steps to reproduce

Create a component with a scoped style (parent) Create a regular component with a template tag (children) Create a functional component that uses h (children)

The regular children inherit the data attribute from the parent The functional children doesn't inherit the data attribute from the parent.

What is expected?

The child functional component should receive the data attributes as if it were a template component

What is actually happening?

Functional and Regular component behaves differently in this instance :

image

I recommend not using the same class 😉.

avatar
Apr 29th 2022

@liulinboyi Thanks for the quick fix 🙏 I used the same class to illustrate the bug visually, but it happened to me in a totally different scenario :D