-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[Bug] undefined
attrs are not being passed
#3953
Comments
This makes attrs and props have a consistent behavior after #3288: you shouldn't differentiate the cases where |
@posva Please pardon me, am I understanding consistency wrong? I've updated my repro, please have a look. import { defineComponent } from 'vue'
export default defineComponent({
inheritAttrs: false,
props: {
baz: String,
},
setup(props, { attrs }) {
// 👇 logs { baz: undefined }
console.log(props)
// 👇 logs { foo: 'foo' }, NOT { foo: 'foo', bar: undefined }
console.log(attrs)
return () => <div>Comp</div>
},
}) |
@posva Thanks for clarifying, another change I overlooked is the following, which caused the confusion, attaching it here for future reference: |
Version
3.1.1
Reproduction link
https://github.com/wenfangdu/vue-attrs-repro
Steps to reproduce
Please use the repro link, this behavior doesn't exist in
v3.0.11
.What is expected?
Attrs with
undefined
are being passed.What is actually happening?
Attrs with
undefined
are not being passed.The text was updated successfully, but these errors were encountered: