Chez
Chez

Reputation: 35

vue-tabs-component v-bind variable in suffix property

He everyone! I have a vue js project and i installed a vue plugin called vue-tabs-component.

Link to repo: https://github.com/spatie/vue-tabs-component

It has an option to show a badge on a certain tab but my problem is that i do not know how to show the count variable into that component property.

So i have this piece of code:

<tabs><tab name="Expired" suffix="<span class='suffix'>5</span>">My tab content</tab></tabs>

How can i bind a dynamic variable in the suffix property.

suffix="<span class='suffix'>5</span>"

Instead of 5 i want to show a dynamic number. How can i do that? Thank you in advance!

Upvotes: 1

Views: 161

Answers (1)

Boussadjra Brahim
Boussadjra Brahim

Reputation: 1

You could use string interpolation and pass the suffix property:

 :suffix="`<span class='suffix'>${suffix}</span>`"

Upvotes: 1

Related Questions