H
H
hckn2018-09-16 18:35:44
Vue.js
hckn, 2018-09-16 18:35:44

How to read the value/presence of an attribute as a parameter?

Imagine there is a component that has a boolean parameter. But this is too verbose. How to use this parameter in the form If there is an attribute , then , if not, then ? I honestly expected it to work out of the box, but alas...
<cool-component :stuff="true"></cool-component>
stuff
<cool-component stuff></cool-component>
stufftruefalse

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-09-16
@hckn

I honestly expected it to work out of the box, but alas...

And it works . Look for a jamb in yourself. Maybe the parameter was not defined as Boolean.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question