message: chore(ImagePreview): optimize event binding
diff: @@ -99,7 +99,10 @@ export default createComponent({
  watch: {
  value(val) {
  if (val) {
  - this.onShow();
  + this.setActive(this.startPosition);
  + this.$nextTick(() => {
  + this.$refs.swipe.swipeTo(this.startPosition, { immediate: true });
  + });
  } else {
  this.$emit('close', {
  index: this.active,
  @@ -108,29 +111,13 @@ export default createComponent({
  }
  },
  - startPosition(active) {
  - this.setActive(active);
  - }
  - },
  -
  - mounted() {
  - if (this.value) {
  - this.bindEvent();
  - }
  + startPosition(val) {
  + this.setActive(val);
  },
  - methods: {
  - onShow() {
  - this.bindEvent();
  - this.setActive(this.startPosition);
  - this.$nextTick(() => {
  - this.$refs.swipe.swipeTo(this.startPosition, { immediate: true });
  - });
  - },
  -
  - bindEvent() {
  - if (!this.eventBinded) {
  - this.eventBinded = true;
  + shouldRender: {
  + handler(val) {
  + if (val) {
  this.$nextTick(() => {
  const swipe = this.$refs.swipe.$el;
  on(swipe, 'touchstart', this.onWrapperTouchStart);
  @@ -140,7 +127,11 @@ export default createComponent({
  });
  }
  },
  + immediate: true
  + }
  + },
  + methods: {
  onWrapperTouchStart() {
  this.touchStartTime = new Date();
  },
  