anderlaini
anderlaini

Reputation: 1831

vuejs - how to set tag parameters based on a condition

I'm showing a v-tippy this way:

<label v-tippy content="My content text">

It is working fine, but I need now to show it based on a condition show_tip == true.

How can I do that?

Upvotes: 1

Views: 584

Answers (1)

Boussadjra Brahim
Boussadjra Brahim

Reputation: 1

In this case use as component not as directive in order to make the conditional rendering :

<tippy v-if="show_tip" content=""My content text" >
       <label slot="trigger" >Label text</label>
</tippy>

or

 <tippy :visible="show_tip" content=""My content text" >
       <label slot="trigger" >Label text</label>
</tippy>

Upvotes: 1

Related Questions