Friday, 22 December 2017

Wondering how to render my Pug mixin from the client.

Hey, I have some ajax that gets items for my page.Since its client-side, is there a simple way to iterate over it and render it via a mixin file instead of sending normal html like this:I saw the API doc but I don't quite understand how to do it, especially how to send the Pug runtime, maybe if I could just use the Pug syntax there that would be cool too, thanks :)import { $ } from './bling'; $('.store__items').innerHTML = response.data.map(item => { return `
${item.name}

${item.description}

${item.name}
`; }).join('');

Submitted December 23, 2017 at 04:43AM by theweedlover420

No comments:

Post a Comment