make webhook buttons have selected class only when the webhook is selected

This commit is contained in:
hippoz 2020-10-13 22:10:01 +03:00
parent 4c5901d614
commit d3c153dc26

View file

@ -14,7 +14,7 @@
<div id="app">
<div class="card navigation-card">
<div class="navigation-buttons">
<a v-for="(webhook, webhookIndex) in webhooks" @click="selectedWebhook = webhookIndex" class="button-default button-selected">{{ webhook.name }}</a>
<a v-for="(webhook, webhookIndex) in webhooks" @click="selectedWebhook = webhookIndex" :class="getWebhookButtonClass(webhookIndex)">{{ webhook.name }}</a>
</div>
</div>
@ -111,6 +111,12 @@
localStorage.clear();
return;
}
},
getWebhookButtonClass: function(webhookIndex) {
if (this.selectedWebhook === webhookIndex) {
return 'button-default button-selected';
}
return 'button-default';
}
},
computed: {