Skip to content

Commit

Permalink
feat(core): slider
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSzidat committed Dec 13, 2021
1 parent 405030e commit 1b72484
Show file tree
Hide file tree
Showing 12 changed files with 771 additions and 59 deletions.
142 changes: 141 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"postcss": "8.3.7"
},
"dependencies": {
"@nuxtjs/eslint-config": "^6.0.1"
"@js-basics/vector": "^1.57.3",
"@nuxtjs/eslint-config": "^6.0.1",
"vue-slick-carousel": "^1.0.6"
}
}
71 changes: 71 additions & 0 deletions packages/core/Slider/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<vue-slick-carousel v-bind="sliderSettings">
<template v-if="$scopedSlots.prev" #prevArrow="arrowOption">
<slot name="prev" :arrowOption="arrowOption" />
</template>
<template v-if="$scopedSlots.next" #nextArrow="arrowOption">
<slot name="next" :arrowOption="arrowOption" />
</template>
<template v-if="$scopedSlots.pagination" #customPaging="page">
<slot name="pagination" :page="page" />
</template>

<template #default>
<slot v-for="(slide, index) in slides" :slide="slide" :index="index" />
</template>
</vue-slick-carousel>
</template>

<script>
import VueSlickCarousel from 'vue-slick-carousel';
import 'vue-slick-carousel/dist/vue-slick-carousel.css';
import 'vue-slick-carousel/dist/vue-slick-carousel-theme.css';
import PointerNavigation from './../mixins/PointerNavigation';
export default {
components: { VueSlickCarousel },
mixins: [PointerNavigation],
props: {
settings: {
type: Object,
default () {
return {};
}
},
slides: {
type: Array,
default () {
return [];
}
}
},
data () {
return {
defaultSettings: {
dots: false,
dotsClass: 'slick-dots custom-dot-class',
edgeFriction: 0.35,
infinite: false,
speed: 300,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false
}
};
},
computed: {
sliderSettings () {
return { ...this.defaultSettings, ...this.settings };
}
},
mounted () {
console.log('mounted slider', this.slides);
}
};
</script>

<style>
</style>
Loading

0 comments on commit 1b72484

Please sign in to comment.