|
|
@@ -1,26 +1,18 @@
|
|
|
<template>
|
|
|
- <div class="nut-swiper" :class="[direction, { dragging: dragging }]" @touchstart="_onTouchStart($event)" @mousedown="_onTouchStart($event)">
|
|
|
- <div
|
|
|
- class="nut-swiper-wrap"
|
|
|
- :style="{
|
|
|
+ <div class="nut-swiper" :class="[direction, { dragging: dragging }]" @touchstart="_onTouchStart($event)"
|
|
|
+ @mousedown="_onTouchStart($event)">
|
|
|
+ <div class="nut-swiper-wrap" :style="{
|
|
|
transform: 'translate3d(' + translateX + 'px,' + translateY + 'px,0)',
|
|
|
'transition-duration': transitionDuration + 'ms',
|
|
|
'-webkit-transform': 'translate3d(' + translateX + 'px,' + translateY + 'px,0)',
|
|
|
'-webkit-transition-duration': transitionDuration + 'ms',
|
|
|
'transition-timing-function': 'ease'
|
|
|
- }"
|
|
|
- @transitionend="_onTransitionEnd"
|
|
|
- >
|
|
|
+ }" @transitionend="_onTransitionEnd">
|
|
|
<slot></slot>
|
|
|
</div>
|
|
|
<div class="nut-swiper-pagination" v-show="paginationVisible">
|
|
|
- <span
|
|
|
- class="swiper-pagination-bullet"
|
|
|
- :class="{ active: index + 1 === currentPage }"
|
|
|
- v-for="(slide, index) in slideEls"
|
|
|
- :key="index"
|
|
|
- @click="paginationClickable && setPage(index + 1, true)"
|
|
|
- >
|
|
|
+ <span class="swiper-pagination-bullet" :class="{ active: index + 1 === currentPage }"
|
|
|
+ v-for="(slide, index) in slideEls" :key="index" @click="paginationClickable && setPage(index + 1, true)">
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -400,6 +392,17 @@ export default {
|
|
|
destroyed() {
|
|
|
this.timer = null;
|
|
|
this.domTimer = null;
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ if (this.keepAlive) {
|
|
|
+ this.keepAlive = false;
|
|
|
+ this.updateEvent();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deactivated() {
|
|
|
+ this.keepAlive = true;
|
|
|
+ this.timer = null;
|
|
|
+ this.domTimer = null;
|
|
|
}
|
|
|
};
|
|
|
</script>
|