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

inheritAttrs: false doesn't work properly with universal mode #7195

Closed
ArtemyNv opened this issue Apr 8, 2020 · 2 comments
Closed

inheritAttrs: false doesn't work properly with universal mode #7195

ArtemyNv opened this issue Apr 8, 2020 · 2 comments

Comments

@ArtemyNv
Copy link

ArtemyNv commented Apr 8, 2020

Version

v2.12.2

Reproduction link

https://github.com/Tibon4ik/nuxt-ssr-inherit-attrs

Steps to reproduce

Clone the repo

  • $ npm install
  • $ npm run dev

What is expected ?

html element with class "app-card" should not have attribute "app-card-prop"
QIP Shot - Screen 009.png

What is actually happening?

html element with class "app-card" has attribute "app-card-prop"
QIP Shot - Screen 010.png

Additional comments?

This bug happens when i use component with inheritAttrs: false, which use another component on top level of section or render function.

I want to pass props to inner component with v-bind="$attrs" and inheritAttrs: false. It passes props inside but still adds attributes to html element.

This issue doesn't occur in "spa" mode but in "universal" mode it exists in "dev" process and stay in "build" + "start" process.

Quick sample:
I have AppCard component
https://monosnap.com/file/GGbNVUgCNQmzGFh46JemMxMubAcxls
And i have PlayerCard component which uses AppCard component and pass props with v-bind="$attrs" and inheritAttrs: false
https://monosnap.com/file/paLwmTwxoiEnL4CFHSXMjaFcmJaN4B
And then i use PlayerCard with prop of AppCard component
https://monosnap.com/file/5Xr7JGoMeS130YqOHZzfLF2RfhFTfE
Resulting html element has "app-card-prop" html attribute (as in "What is actually happening?" section)

I noticed that this bug doesn't occur in next cases:

@ghost ghost added the cmty:bug-report label Apr 8, 2020
@manniL
Copy link
Member

manniL commented Apr 8, 2020

This sounds like a vue-server-renderer issue at first.
Could you check if it behaves the same "wrong" way when using just vue-server-renderer? (Example of how to create a reproduction: vuejs/vue#10733)

@ArtemyNv
Copy link
Author

ArtemyNv commented Apr 8, 2020

Yes, it is a problem of vue-server-renderer. Same bug there. Further info in vuejs/vue#11297.

P.S. Thank you for example.

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

No branches or pull requests

3 participants