vue-property-decorator
vue-property-decorator copied to clipboard
Property with no value doesn't imply true, using decorator without type.
Describe the bug For the Vue components property, no-value property imply true. (https://vuejs.org/v2/guide/components-props.html#Passing-a-Boolean) But without type definition of Prop Decorator, it can't be worked. Below is the example.
Template :
<my-template editable>
Component (maybe bug) :
@Prop() editable!: boolean;
=> editable is false.
Component (works well) :
@Prop(Boolean) editable!: boolean;
=> editable is true!
Of course, included 'reflect-metadata' and set emitDecoratorMetadata to true.
I also would consider it as a bug
@Prop(Boolean) editable!: boolean;
is redundant and doesn't really fit to the whole purpose of the decorators.
I will try to create a fix for it. Is there anyone who has a suggestion for the solution?
https://github.com/kaorun343/vue-property-decorator#if-youd-like-to-set-type-property-of-each-prop-value-from-its-type-definition-you-can-use-reflect-metadata