egjs-flicking icon indicating copy to clipboard operation
egjs-flicking copied to clipboard

Pagination disappears when changing 'moveCount' in the Arrow plugin in Vue v4.x

Open nomve opened this issue 1 year ago • 0 comments

Hi,

I have a setup where the Pagination and Arrow plugin is used, and the Arrow plugin has the moveCount setting which can be changed in the app. Like so

const plugins = computed(() => {
  return [
    new Pagination(),
    new Arrow({
      moveCount: moveCount.value
    })
  ]
})

When I update the moveCount, it works but the pagination disappears, I can see the pagination/bullets container gets emptied.

Reproduction: https://stackblitz.com/~/github.com/nomve/vue-flicking-reactive-plugins

I am on the latest version.

I've tried removing the :plugins option from the Flicking Vue component and adding the plugins myself

const plugins = computed(...) // same as above
const flicking = ref()

watch([flicking, plugins], ([flicking, plugins]) => {
  if (flicking) {
    flicking.removePlugins(...flicking.activePlugins)
    flicking.addPlugins(...plugins)
  }
})

this works, but something is off with the calculation of the bullet points, they change in count.

nomve avatar Mar 11 '25 12:03 nomve