niko craft
niko craft

Reputation: 2977

refreshing v-for loop for a specific reason

I am using a jquery plugin slider pro with my vue app. There is a problem I run into when calling destroy method of this plugin so that it destroys the instance of the plugin, the html classes added by this plugin are left in the html code. I would like to refresh my v-for rendering which would then automatically clean up whatever the slider pro has added to the html markup of slides.

Is is possible to refresh v-for loop so it re-renders? If yes how? If no, is there a dirty trick I could use to accomplish this?

Upvotes: 1

Views: 2063

Answers (2)

Bert
Bert

Reputation: 82469

You can force the Vue to re-render using $forceUpdate.

Upvotes: 1

kevguy
kevguy

Reputation: 4438

Try assigning a new value to the array you're using to trigger a state update:

Vue.set(yourArray, 0, yourArray[0])

Upvotes: 3

Related Questions