Reputation: 11661
In Vue, how to render to
property by condition?
for example I have this markup and by set clickable=true
then this div
will have :to
property if not, will have regular div (no :to
).
<div :to="path">
<img src="..." />
</div>
Upvotes: 0
Views: 51
Reputation: 83
I think you can use something like this:
<div v-if="clickable" :to="path">
<img src="..." />
</div>
<div v-else>
<img src="..." />
</div>
Upvotes: 0