Skip to content

Commit 9e52864

Browse files
committed
feat: validate preventExcessiveDragging carousel prop and log warning
1 parent c4b4546 commit 9e52864

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/Carousel/carouselProps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ export const carouselProps = {
123123
},
124124
preventExcessiveDragging: {
125125
default: false,
126-
type: Boolean
126+
type: Boolean,
127+
validator(value: boolean, props) {
128+
if (value && props.wrapAround)
129+
console.warn(
130+
'[vue3-carousel warn]: preventExcessiveDragging cannot be used with wrapAround. ' +
131+
'The preventExcessiveDragging setting will be ignored.'
132+
);
133+
134+
return true;
135+
}
127136
}
128137
}

0 commit comments

Comments
 (0)