I am currently working with Laravel 8 and using blade syntax. The following code snippet is from a Vue component I created:
<li class="w-3/12 md:w-auto pt-0 md:px-4 md:pt-2 md:pb-0 list-none relative"
v-if="comic.item_type === 'b' && comic.stock > 0"
v-for="(comic, index) in [...list].slice(0, 20)">
within the
.slice(0, 20)
I want to make the number 20 dynamic. My goal is to limit the rendered items to 20 initially, and then allow users to load more by clicking on a button that increments this parameter by 20 each time.
As a beginner in Vue, I'm open to suggestions for better approaches if they exist!
I attempted to bind a variable as the second parameter, but it resulted in an error since it's not intended to be used in that manner.