Fix controlled demo clicks
parent
d50ebae1e5
commit
7b09579d2c
|
@ -103,10 +103,10 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
next() {
|
next() {
|
||||||
this.activeIndex = this.activeIndex === this.images.length - 1 ? 0 : this.activeIndex + 1;
|
this.activeIndex = this.activeIndex === this.images.length - 1 ? this.images.length - 1 : this.activeIndex + 1;
|
||||||
},
|
},
|
||||||
prev() {
|
prev() {
|
||||||
this.activeIndex = this.activeIndex === 0 ? 0 : this.images.length - 1;
|
this.activeIndex = this.activeIndex === 0 ? 0 : this.activeIndex - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -155,10 +155,10 @@ const responsiveOptions = ref([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const next = () => {
|
const next = () => {
|
||||||
activeIndex.value = activeIndex.value === images.value.length - 1 ? 0 : activeIndex.value + 1;
|
activeIndex.value = activeIndex.value === images.value.length - 1 ? images.value.length - 1 : activeIndex.value + 1;
|
||||||
};
|
};
|
||||||
const prev = () => {
|
const prev = () => {
|
||||||
activeIndex.value = activeIndex.value === 0 ? 0 : images.value.length - 1;
|
activeIndex.value = activeIndex.value === 0 ? 0 : activeIndex.value - 1;
|
||||||
};
|
};
|
||||||
<\/script>`,
|
<\/script>`,
|
||||||
data: `
|
data: `
|
||||||
|
@ -179,10 +179,10 @@ const prev = () => {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
next() {
|
next() {
|
||||||
this.activeIndex = this.activeIndex === this.images.length - 1 ? 0 : this.activeIndex + 1;
|
this.activeIndex = this.activeIndex === this.images.length - 1 ? this.images.length - 1 : this.activeIndex + 1;
|
||||||
},
|
},
|
||||||
prev() {
|
prev() {
|
||||||
this.activeIndex = this.activeIndex === 0 ? 0 : this.images.length - 1;
|
this.activeIndex = this.activeIndex === 0 ? 0 : this.activeIndex - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue