Subscribe on changes!

[FR] App config to set `inheritAttrs: false` globally

avatar
Jun 11th 2023

What problem does this feature solve?

The default behavior inheritAttrs: true is almost never the desired case for encapsulating components, I have to set inheritAttrs: false for pretty much all components that I write in real projects. I understand making inheritAttrs: false the default would be a huge breaking change: https://github.com/vuejs/rfcs/pull/26, but at least provide an option to set inheritAttrs: false globally for all components.

What does the proposed API look like?

app.config.inheritAttrs = false

avatar
Jun 11th 2023

I believe that most userland applications require inherited attributes. Like Only 8 files have inheritAttrs set in Elk.

Perhaps we could include an option to change its default behavior.

avatar
Jun 14th 2023

This affects all Vue components inside an app including third-party ones. I'd say setting inheritAttrs: false at global level has a fairly big chance to break some of them but the problem it brings can be very hard to identify and locate.