drewjbartlett / vue-flickity

A Vue Slider / Carousel Component for Flickity.js
http://drewjbartlett.com/demos/vue-flickity/
374 stars 55 forks source link

How to use append #22

Closed jmharveys closed 6 years ago

jmharveys commented 7 years ago

Hi,

sorry to write over here, but I don't get it how to use the

append

function with vue-flickity.

this.$refs['flickityCarousel_' + this.uid].append('<div>Append this thing into my carousel</div>') is not working. I would like to append a new slice, once my slider is mounted.

If I put a console.log into the vue-flickity.vue file for testing, I've got my element in the console, but it's not append to the carousel.

Any clue?

Thanks

groman00 commented 7 years ago

@jmharveys Try creating a div element and appending that, instead of a string

var newDiv = document.createElement('DIV');
newDiv.innerText = 'Append this thing into my carousel';
this.$refs['flickityCarousel_' + this.uid].append(newDiv);
jmharveys commented 6 years ago

Thank you!