I’m using kitchen sink cards as example and I’m trying to add cards dynamically with this code:
indent preformatted text by 4 spaces
on: {
pageInit: function () {
for (var idx = 0; idx <= 10; idx++) {
var card =
'<div class="card demo-card-header-pic">'
+'<div style="link-with-image.jpg)"'
+'valign="bottom" class="card-header no-border"></div>'
+'<div class="card-content card-content-padding">'
+'<p class="date">bla bla bla bla bla bla bla bla bla</p>'
+'</div>'
+'<div class="card-footer">'
+'<a href="#" class="link" @click="openStandalone">photos</a>'
+'<a href="#" class="link sheet-open" data-sheet=".demo-sheet">More Information</a>'
+'</div>'
+'</div>'
document.getElementById('cards').innerHTML = card;
}
indent preformatted text by 4 spaces
your only chance is to attach event
to an element presented in compo-obj
at the moment it get parsed <div class="cards-container" @click="dynOpenStandalone"></div>
and then you can add elements dynamically <div class="card dynamically-added"></div>
Thank you guys for your help, all cards are being generated dynamically, but the code below its still not working even using the tip on the post above.