-
Notifications
You must be signed in to change notification settings - Fork 431
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
A bug when a field has undefined value #39
Comments
This restriction is needed because it will accidentally collect undefined value if we use babel + some property decorators. I'll write about this into readme later. |
@ktsn class Foo extends Vue {
key1 = 1;
key2 = undefined;
}
means class Foo extends Vue {
key1 = 1;
data () {
return {
key2: undefined
};
}
} or class Foo extends Vue {
data () {
return {
key1: 1,
key2: undefined
};
}
} or something else? Sorry I didn't follow. |
@plantain-00 Yes, you are right. |
@ktsn Is this ever get fixed? |
This behavior cost me quite a lot of time. Is there documentation why it is the way it is @ktsn ? I checked the README but it didn't have the aforementioned explanation. So, you can do:
And end up with strange errors about the field being missing even though it's CLEARLY there. Very counter intuitive. I think this is made worse by the TypeScript Thank you for your help! |
Sorry, I totally forgot to write about this behavior in readme. I've just done. cb8d9de |
Thank you for that |
just use vue, this works
use vue-class-component, the
key
is not foundI checked the source code, should be: https://github.com/vuejs/vue-class-component/blob/master/src/data.ts#L23
the type of my
key
isundefined | null
, so I cannot use null to replace undefined.The text was updated successfully, but these errors were encountered: