:disable link when data: false?

How do I disable a link when href data is set to false?
The reason is I want the image to show a low opacity icon when no links are available.

<a :href="data" >
<img />
</a>
<a :href="data" :class="{ 'disabled' : !data }">

Then in your css:

.disabled {
   pointer-events: none;
   opacity: .5;
   // any other styles you need
}