In my Vue component, I have a Boolean prop called "obj", defined like this:
obj: { Type:Boolean, default: false}
I can set it to true
like this:
<my-component :obj="true"></my-component>
However, I'd like to be able to set it to true
like this:
<my-component obj></my-component>
I'd like the presence of the prop to mean true
and its absence to mean false
. Is there a way to define a prop that works this way in a Vue component?
type
, not Type. Unless that's a typo – kingdaro