Skip to content

Commit

Permalink
Merge pull request #2 from SchnapsterDog/develop
Browse files Browse the repository at this point in the history
fix: replace itemWidth with width prop, updated certain props type
  • Loading branch information
SchnapsterDog authored Dec 13, 2022
2 parents f49d7d1 + f0b2369 commit 022fe30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-marquee-slider",
"description": "Simple and easy-to-use component for Vue that allows you to create customizable marquees with just a few lines of code",
"version": "1.0.0",
"version": "1.0.1",
"private": false,
"author": {
"name": "Oliver Trajceski",
Expand Down
26 changes: 13 additions & 13 deletions src/components/MarqueeSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>
<script>
export default {
name: 'VueMarqueeSlider',
name: 'MarqueeSlider',
props: {
autoWidth: {
type: Boolean,
Expand All @@ -16,16 +16,10 @@ export default {
}
},
id: {
type: [Number, String],
type: String,
required: true,
default: () => {
return 'id'
}
},
itemWidth: {
type: Number,
default: () => {
return 200
return 'id'
}
},
paused: {
Expand Down Expand Up @@ -53,10 +47,16 @@ export default {
}
},
speed: {
type: [Number, String],
type: Number,
default: () => {
return 1500
}
},
width: {
type: Number,
default: () => {
return 100
}
}
},
data() {
Expand Down Expand Up @@ -121,7 +121,7 @@ export default {
this.items[index].style.marginRight = `${this.space}px`
},
setItemWidth(index) {
this.items[index].style.minWidth = `${this.itemWidth}px`
this.items[index].style.minWidth = `${this.width}px`
},
setImageObjectFit(index) {
this.items[index].style.objectFit = 'contain'
Expand All @@ -133,13 +133,13 @@ export default {
if (this.autoWidth) {
this.container.style.width = `${this.itemsLength * (this.containerWidth / this.itemsLength + this.space)}px`
} else {
this.container.style.width = `${this.itemsLength * (this.itemWidth + this.space)}px`
this.container.style.width = `${this.itemsLength * (this.width + this.space)}px`
}
}
}
}
</script>
<style module scoped>
<style module>
.marqueeSlider {
overflow: hidden;
}
Expand Down

0 comments on commit 022fe30

Please sign in to comment.