Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Property with no value doesn't imply true, using decorator without type. #347

Open
bychung opened this issue Oct 5, 2020 · 2 comments
Open

Comments

@bychung
Copy link

bychung commented Oct 5, 2020

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.

@azollai
Copy link

azollai commented May 3, 2021

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?

@CostaIsNotAvailable
Copy link

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

No branches or pull requests

3 participants