This is my pug file
for specificBike in allBikeData
.bikeshop-card.border.border-dark.bg-white.m-3.p-4
li
img.shop-image.border.border-dark(src=specificBike.image, onerror="this.onerror=null; this.src='https://imgur.com/qzN3r1U.png'" alt="")
li
img(src=specificBike.logo, alt="")
li
a.text-dark(href=specificBike.website)
h3.font-weight-bold=specificBike.shopname
li
h4=specificBike.contact
li
h4
span.glyphicon.glyphicon-earphone
p=specificBike.phone
li
h4
span.glyphicon.glyphicon-home
p=specificBike.address
li
a.btn.btn-success(href=specificBike.facebook) Facebook
a.btn.btn-success.ml-1(href=specificBike.instagram) Instagram
And This is my script:
script.
allBikeData = !{JSON.stringify(allBikeData)}
const addMoreJson = (num) => {
for(let i = 0; i < num; i++)
loadData()
}
addMoreJson(12)
I'm looking to showcase 12 data entries per page. As users scroll down, an additional 12 entries should load. I've been struggling to implement this functionality using pug. My attempts involved creating a function named 'loadData()' that interacts with the 'allBikeData' JSON and calling this function inside a loop. Can someone guide me on how to achieve this using pug?