Is there a way to prevent the button from being clickable when the current page is the first page?
Although the button disables as expected, I'm still encountering an issue where the route changes when it's clicked.
Code Snippet (Javascript)
checkDisable() {
if (this.currentPage == 1) {
document.getElementById("previousBtn").disabled = true;
}
}
Code Snippet (Vue.js)
<router-link :to="{ name: 'products', params: {page: currentPage-1 }}">
<button id="previousBtn" class="btn btn-default" v-bind="checkDisable()">
Previous
</button>
</router-link>