diff --git a/README.md b/README.md index 1fdb882..e2df089 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Требования -- [Swiper](https://github.com/nolimits4web/swiper) версии 4.5.x +- [Swiper](https://github.com/nolimits4web/swiper) версии ^10.2.0 ## Подключение и настройка diff --git a/index.js b/index.js index f7aafa9..63f1c1a 100644 --- a/index.js +++ b/index.js @@ -97,8 +97,10 @@ const show = async (duration = 500, easing = 'linear') => { }; const init = async (items = [], options = {}, index = 0) => { - const {Swiper, Navigation, Pagination} = await import('swiper'); - Swiper.use([Navigation, Pagination]); + const [{default: Swiper}, {Navigation, Pagination}] = await Promise.all([ + import('swiper'), + import('swiper/modules'), + ]); let isVideoInGallery = false; items = items.map((item) => { @@ -153,7 +155,7 @@ const init = async (items = [], options = {}, index = 0) => { -