Created
August 19, 2020 16:57
-
-
Save git-bhanu/2f9660dd0b4277b65293843b9048eb91 to your computer and use it in GitHub Desktop.
Importing and Exporting ES6 modules for sage roots.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAGE NAME : group-slider.js at "script/components/group-slider.js" | |
////////////////////////////// | |
import Swiper, {Navigation, Pagination} from 'swiper'; | |
Swiper.use([Navigation, Pagination]); | |
const groupSlider = new Swiper('#group-cards', { | |
spaceBetween: 5, | |
speed: 300, | |
loop: true, | |
centeredSlides: true, | |
slidesPerView: 'auto', | |
mousewheelControl: true, | |
keyboardControl: true, | |
observer: true, | |
observeParents: true, | |
breakpoints: { | |
728: { | |
grabCursor: true, | |
observer: true, | |
observeParents: true, | |
slidesPerView: 3, | |
spaceBetween: 25, | |
mousewheelControl: true, | |
keyboardControl: true, | |
centeredSlides: false, | |
}, | |
}, | |
pagination: { | |
el: '.swiper-pagination', | |
clickable: true, | |
}, | |
navigation: { | |
nextEl: '.group-swiper-button-next-outside', | |
prevEl: '.group-swiper-button-prev-outside', | |
}, | |
}) | |
export default groupSlider; | |
//////////////////////////// | |
I have to now use this at my home.js router file then | |
/////////////////////////// | |
import groupSlider from '../components/group-slider'; | |
export default { | |
init() { | |
groupSlider.init(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment