AlpineJS hide button if total is less that offset and limit

27 Views Asked by At

I am trying to hide a button if my total number is less than limit + offset,

My button

<div @click="loadMore()" x-show="total > (limit + offset)" class="text-center pt-4">
                 <button class="border border-solid border-slate-700 text-slate-100 hover:bg-slate-800 px-4 py-2"> Load More </button>
            </div>

My data in console

action: filterPosts
limit: 6
post_type_js: videos
offset: 0
category: 1094
total: 28

I believe the way i have my button set is if total is more than limit + offset how, else hide. but the button is not showing.

0

There are 0 best solutions below