comand-component-library 3.1.75 → 3.1.76

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "3.1.75",
3
+ "version": "3.1.76",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -10,13 +10,13 @@
10
10
 
11
11
  <!-- begin area to slide -->
12
12
  <transition name="fade">
13
- <a v-if="currentItem.href" :href="currentItem.href" :key="index" :title="currentItem.title">
13
+ <a v-if="currentItem?.href" :href="currentItem.href" :key="index" :title="currentItem.title">
14
14
  <figure v-if="currentItem && !useSlot" class="slideshow-item">
15
15
  <img :src="currentItem.imgPath" :alt="currentItem.alt"/>
16
16
  <figcaption>{{ currentItem.figcaption }}</figcaption>
17
17
  </figure>
18
18
  </a>
19
- <figure v-else-if="!currentItem.href && currentItem && !useSlot" :key="index" class="slideshow-item">
19
+ <figure v-else-if="currentItem && !currentItem.href && currentItem && !useSlot" :key="index" class="slideshow-item">
20
20
  <img :src="currentItem.imgPath" :alt="currentItem.alt"/>
21
21
  <figcaption>{{ currentItem.figcaption }}</figcaption>
22
22
  </figure>
@@ -160,14 +160,12 @@ export default {
160
160
  }
161
161
  this.preload(this.index)
162
162
  },
163
-
164
163
  showItem(i) {
165
164
  if (i >= 0 && i < this.slideshowItems.length) {
166
165
  this.index = i;
167
166
  this.preload(this.index);
168
167
  }
169
168
  },
170
-
171
169
  showNextItem() {
172
170
  if (this.useSlot) {
173
171
  if (this.currentSlotItem < Object.keys(this.$slots).length - 1) {
@@ -240,10 +238,12 @@ export default {
240
238
  /* computed property to get current slide */
241
239
  computed: {
242
240
  currentItem() {
243
- return this.getDeviceImage(this.slideshowItems[this.index]);
241
+ if(this.slideshowItems.length <= this.index) {
242
+ return null
243
+ }
244
+ return this.getDeviceImage(this.slideshowItems[this.index])
244
245
  }
245
246
  },
246
-
247
247
  watch: {
248
248
  slideshowItems: {
249
249
  handler() {