Skip to content

Commit 262c9f5

Browse files
committed
refactor: CCarouselItem: delete imgSrc prop, change image prop behavior
1 parent 3b509a7 commit 262c9f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/Carousel/CCarouselItem.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<template>
22
<div :class="itemClasses">
33
<CImage
4-
v-if="image || imgSrc"
5-
:src="imgSrc"
6-
v-bind="image"
4+
v-bind="computedImage"
75
class="c-d-block c-w-100 c-h-100 c-img-fluid"
86
/>
97
<slot>
@@ -23,8 +21,7 @@ export default {
2321
CImage
2422
},
2523
props: {
26-
image: Object,
27-
imgSrc: String,
24+
image: [String, Object],
2825
caption: String,
2926
text: String,
3027
active: Boolean
@@ -53,6 +50,9 @@ export default {
5350
'c-active': this.activated
5451
}
5552
]
53+
},
54+
computedImage () {
55+
return typeof this.image === 'string' ? { src: this.image } : this.image
5656
}
5757
},
5858
methods: {

0 commit comments

Comments
 (0)