Vue-awesome-swiper: updated() lifecycle hook invokes swiper's update() resulting in bad swiping performance.

Created on 13 Oct 2018  ·  1Comment  ·  Source: surmon-china/vue-awesome-swiper

BUG REPORT TEMPLATE

Vue.js version and component version

2.5.17, 3.1.3

Reproduction Link

None. It's logically perceivable.

Steps to reproduce

Have a data change in parenting component.

What is Expected?

Good performance, update getting invoked only on props changed. At least add an option to skip invokations, without need to comment out the update() invokation.

What is actually happening?

Updated is invoked on any data change invoking update on swiper as often as the number of changed data elements (including computed). This results in very bad performance.

Most helpful comment

我也遇到相同的问题。
我将源码从node_modules拷贝出来了,然后修改了slide.vue,强制屏蔽了所有update操作。
或者自己基于原始的swiper封装一个vue组件。

...
 updated() {
    if (this.$parent.options && this.$parent.options.isUpdate) {
      this.update()
    }
  },

>All comments

我也遇到相同的问题。
我将源码从node_modules拷贝出来了,然后修改了slide.vue,强制屏蔽了所有update操作。
或者自己基于原始的swiper封装一个vue组件。

...
 updated() {
    if (this.$parent.options && this.$parent.options.isUpdate) {
      this.update()
    }
  },

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tiamatmate picture Tiamatmate  ·  3Comments

cycold picture cycold  ·  3Comments

bourhaouta picture bourhaouta  ·  3Comments

yanxileo picture yanxileo  ·  3Comments

baokuanze picture baokuanze  ·  5Comments