{"_id":"@brunobesson/vue-awesome-swiper","_rev":"4-a3aea332722ba5577aaa092142c6335b","time":{"created":"2022-06-22T13:39:07.647Z","4.1.2":"2022-06-22T13:28:01.732Z","modified":"2022-06-22T13:56:31.997Z","4.1.3":"2022-06-22T13:39:07.905Z","4.1.4":"2022-06-22T13:56:31.916Z"},"name":"@brunobesson/vue-awesome-swiper","dist-tags":{"latest":"4.1.4"},"versions":{"4.1.3":{"name":"@brunobesson/vue-awesome-swiper","description":"Swiper component for Vue","version":"4.1.3","keywords":["vue swiper","vue awesome swiper","vue carrousel","carrousel","swiper"],"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/brunobesson/vue-awesome-swiper.git"},"bugs":{"url":"https://github.com/brunobesson/vue-awesome-swiper/issues"},"homepage":"https://github.com/brunobesson/vue-awesome-swiper","author":{"name":"Bruno Besson","url":"https://github.com/brunobesson"},"main":"dist/vue-awesome-swiper.js","module":"dist/vue-awesome-swiper.esm.js","browser":"dist/vue-awesome-swiper.js","jsdelivr":"dist/vue-awesome-swiper.js","unpkg":"dist/vue-awesome-swiper.js","jspm":{"main":"dist/vue-awesome-swiper.esm.js","registry":"npm","format":"esm"},"types":"dist/index.d.ts","scripts":{"cleanup":"rm -rf ./dist/*","build":"npm run cleanup && cross-env NODE_ENV=production abc build","lint":"abc lint --ext .ts,.vue src tests","test":"abc test","test:watch":"abc test --watch -i","rebirth":"npm run lint && npm test && npm run build","release":". ./scripts/release.sh"},"peerDependencies":{"swiper":"^5.2.0 || ^6.0.0","vue":"2.x"},"devDependencies":{"@brunobesson/abc-factory":"^0.3.3","@types/swiper":"^5.2.1","cross-env":"^6.0.3","swiper":"^5.2.0 || ^6.0.0","typescript":"^3.7.5","vue":"^2.6.10"},"engines":{"node":">=8"},"gitHead":"51743b52c66fb25cb6db18b8589e115a6d51b245","_id":"@brunobesson/vue-awesome-swiper@4.1.3","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-NJ84bW4UhP8ovbqmLPSHR51ssVRIVEE48L2DPF3oPoQZlyRkFYN2odco80iFqjXPIRRFu/OedkItuzWri3ejiw==","shasum":"9b9b51504d2a8bf92967ba5a846fee85dada8a8d","tarball":"https://registry.npmjs.org/@brunobesson/vue-awesome-swiper/-/vue-awesome-swiper-4.1.3.tgz","fileCount":12,"unpackedSize":33247,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENFJVJtG5OiCgQ8DxbDwb4qDLZyLDXUIwWF4rWpuOr7AiEArIKB/omKmO28etrV3TZOTRMpVwxXChCsEm14nKLYM8o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisxt7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3CQ/+IZc7r8FoaLQBtnn60IryGY2QwJKqiwZIqNHHEN0NK08rSuaC\r\nXOgWrA/I0/dm7E3SbdUVdUDGtteQP4uawqAkUTzxij5rJ0BnkjliEeZFssFg\r\ndXfokwLDmKs5DF56hVTCT10XH41LxyMnwrec7EwnAbYudVuUynZk6SfAUB9e\r\nKFu9sx45rw1Dxa0vp2HnwL0vh+IktRPjSs/Kre9WBsKqw3FfQkgy5lSFtzC0\r\neuXDKEojXK2iWCEMrcQB1xfkfF5Z34TgM6FnvpmKkVNErPA7FELzkW45jCwi\r\niKKaagTGYdkyG4dUSJXTRkHJXaonOD9tY8uXnF41JA2L6ikO8H7enLEQDCHN\r\nKavbGjHTKvEQ4+iEdPP4w6XNKysEk2SyDBuzIXqEk7HGPhcihthYhv/ULopI\r\nZ01LaikNGifBSWdt6HonxrjaZIKmOJ6+0F0lqtcQu0dazlaTKPVSj2/9hcTQ\r\n32CmevHaeEnYiJQIT/Hn7yHkKb19a4vo5E7WuKPkHNID7M3z1JB/wBY8j8vT\r\nj+WeqJlq0nKtGbjCCIqfLiaOl9ZMmzvafoGYcZQyR2kZn6lZsIjRxQjIHIV3\r\nqndkq+YdLBGaavaNq9qrXbGkkDUE/YY05g9CU/IWlYME07NqF0LnD7/OHqyS\r\nqqh6mafbQtxl/YCyEoU/sY7a56k6sjdFnvA=\r\n=PAoY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brunobesson","email":"bruno.besson@gmail.com"},"directories":{},"maintainers":[{"name":"brunobesson","email":"bruno.besson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-awesome-swiper_4.1.3_1655905147724_0.9587084376262516"},"_hasShrinkwrap":false},"4.1.4":{"name":"@brunobesson/vue-awesome-swiper","description":"Swiper component for Vue","version":"4.1.4","keywords":["vue swiper","vue awesome swiper","vue carrousel","carrousel","swiper"],"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/brunobesson/vue-awesome-swiper.git"},"bugs":{"url":"https://github.com/brunobesson/vue-awesome-swiper/issues"},"homepage":"https://github.com/brunobesson/vue-awesome-swiper","author":{"name":"Bruno Besson","url":"https://github.com/brunobesson"},"main":"dist/vue-awesome-swiper.js","module":"dist/vue-awesome-swiper.esm.js","browser":"dist/vue-awesome-swiper.js","jsdelivr":"dist/vue-awesome-swiper.js","unpkg":"dist/vue-awesome-swiper.js","jspm":{"main":"dist/vue-awesome-swiper.esm.js","registry":"npm","format":"esm"},"types":"dist/index.d.ts","scripts":{"cleanup":"rm -rf ./dist/*","build":"npm run cleanup && cross-env NODE_ENV=production abc build","lint":"abc lint --ext .ts,.vue src tests","test":"abc test","test:watch":"abc test --watch -i","rebirth":"npm run lint && npm test && npm run build","release":". ./scripts/release.sh"},"peerDependencies":{"swiper":"^5.2.0 || ^6.0.0","vue":"2.x"},"devDependencies":{"@surmon-china/abc-factory":"^0.3.3","@types/swiper":"^5.2.1","cross-env":"^6.0.3","swiper":"^5.2.0 || ^6.0.0","typescript":"^3.7.5","vue":"^2.6.10"},"engines":{"node":">=8"},"gitHead":"34c2d2a24ef6c71f25642342911890fbeea3a90b","_id":"@brunobesson/vue-awesome-swiper@4.1.4","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-PhYywqU3fJzi75y9Om6eVpF0dem1tUcUXyq82GVJxjRDy998CFEgdqxYtxbc89viy3gd7sKAwhNbfgty43besg==","shasum":"6290a06ce889f96106c34c5b13cef196f8788b0d","tarball":"https://registry.npmjs.org/@brunobesson/vue-awesome-swiper/-/vue-awesome-swiper-4.1.4.tgz","fileCount":24,"unpackedSize":126281,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8kEpHIQv5PnDOctKocmqgxR35fUAnh2X3dE+3lefE1AiEAmo71vYjTDcWH3QmjxWmTDm4MtiU5lMsFwXi7LMoFYJY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisx+PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHJw//WITkigGIcyzmhZV7WRBuTjmL19qfxDay1wMW95epY/4VG/eH\r\nuNwJ4Jj/g+7IpnobVI+wQlw9sUBJSQjgK05BUJ6nYrC4D0xWt27gGPfDJ7FA\r\nzqXeCkWRbRD+BnKAAMBlenYr4/Vyu5NkZ9sZyy/IkbYW/EbSErmmKsFZzWzd\r\n4pfFe88ISPiSyXBtv/tZDfG31Mu0wDfyIorqxFGR5LI26jYV72TDmAzg1Tlc\r\nW3IQMbJRIEd/CrF+ETsz9gmlRfPE/Q7lqx4YonQoLVUc2/xNWcudjO6qqjwj\r\nt/TLAU4RD3RSj0BqXxt2Q0n01C/k76CmeDG1l1lZY5K1vG+qal2qmG3isOlr\r\nx8R77bH9zAOrqQTrPeOIymFoM+SbbKh0EMd67tw38Hd0yWq8ledPbGXHcKx9\r\naZpC3WYTGGrZM9k45CRkHfzkTa2ZFAX+XxfKid+RG/k1YmHp/+GHPVWMy5n7\r\nyWoZDRmxLxT9o/hIZ8msrSBR6pZqkOl9z0VFalLaAeYcMK2D/KR5wUPaiZH3\r\n9ZrGAswF+9NIelz7F9+mFtwnsJ/QA0ZzRhecsbnQnBItT6W3U439wVuomKHO\r\ndNA+SkC1UydKjasTbisNQqcGLaKFQ4Fia1SzsQXS0xhmAAujkCTgEvgbX9Wk\r\nBBd+m3jhV+TJlGg/C08fLy5/Tut7oE5hEpI=\r\n=v3It\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brunobesson","email":"bruno.besson@gmail.com"},"directories":{},"maintainers":[{"name":"brunobesson","email":"bruno.besson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-awesome-swiper_4.1.4_1655906191765_0.6076296694573209"},"_hasShrinkwrap":false}},"maintainers":[{"name":"brunobesson","email":"bruno.besson@gmail.com"}],"description":"Swiper component for Vue","homepage":"https://github.com/brunobesson/vue-awesome-swiper","keywords":["vue swiper","vue awesome swiper","vue carrousel","carrousel","swiper"],"repository":{"type":"git","url":"git+https://github.com/brunobesson/vue-awesome-swiper.git"},"author":{"name":"Bruno Besson","url":"https://github.com/brunobesson"},"bugs":{"url":"https://github.com/brunobesson/vue-awesome-swiper/issues"},"license":"MIT","readme":"<p align=\"center\">\r\n  <a href=\"https://swiperjs.com\" target=\"_blank\">\r\n    <img width=\"77px\" src=\"https://github.surmon.me/images/common/swiper-logo.svg\" />\r\n  </a>\r\n  <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>\r\n  <a href=\"https://vuejs.org\" target=\"_blank\">\r\n    <img width=\"77px\" src=\"https://github.surmon.me/images/common/vue-logo.png\" />\r\n  </a>\r\n</p>\r\n\r\n# vue-awesome-swiper\r\n![vue](https://img.shields.io/badge/MADE%20WITH-VUE-42a97a?style=for-the-badge&labelColor=35495d)\r\n[![GitHub stars](https://img.shields.io/github/stars/surmon-china/vue-awesome-swiper.svg?style=for-the-badge)](https://github.com/surmon-china/vue-awesome-swiper/stargazers)\r\n[![npm](https://img.shields.io/npm/v/vue-awesome-swiper?color=c7343a&label=npm&style=for-the-badge)](https://www.npmjs.com/package/vue-awesome-swiper)\r\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/surmon-china/vue-awesome-swiper/Publish?label=publish&style=for-the-badge)](https://github.com/surmon-china/vue-awesome-swiper/actions?query=workflow%3APublish)\r\n[![GitHub issues](https://img.shields.io/github/issues-raw/surmon-china/vue-awesome-swiper.svg?style=for-the-badge)](https://github.com/surmon-china/vue-awesome-swiper/issues)\r\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge)](https://github.com/surmon-china/vue-awesome-swiper/blob/master/LICENSE)\r\n\r\n[![NPM](https://nodei.co/npm/vue-awesome-swiper.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/vue-awesome-swiper)\r\n\r\n**[Swiper](https://swiperjs.com)** component for Vue.\r\n\r\nOld versions:\r\n- Swiper 4: [v3.1.3](https://github.com/surmon-china/vue-awesome-swiper/tree/v3.1.3)\r\n- Swiper 3: [v2.6.7](https://github.com/surmon-china/vue-awesome-swiper/tree/v2.6.7) \r\n\r\n\r\n### Example\r\n- [Online examples](https://github.surmon.me/vue-awesome-swiper)\r\n- [CDN example](https://jsfiddle.net/surmon/kLtj6h3p/)\r\n- [SSR example code](https://github.com/surmon-china/surmon-china.github.io/tree/source/projects/vue-awesome-swiper/nuxt)\r\n- [TypeScript & composition-api example code](https://github.com/surmon-china/surmon-china.github.io/blob/source/projects/vue-awesome-swiper/examples/00-typescript-composition-api.vue)\r\n\r\n---\r\n\r\n### Install\r\n\r\n``` bash\r\nnpm install swiper vue-awesome-swiper --save\r\n\r\n# or\r\nyarn add swiper vue-awesome-swiper\r\n\r\n# Swiper5 is recommended\r\nyarn add swiper@5.x vue-awesome-swiper\r\n```\r\n\r\n### Global Registration\r\n\r\n``` javascript\r\nimport Vue from 'vue'\r\nimport VueAwesomeSwiper from 'vue-awesome-swiper'\r\n\r\n// import style (>= Swiper 6.x)\r\nimport 'swiper/swiper-bundle.css'\r\n\r\n// import style (<= Swiper 5.x)\r\nimport 'swiper/css/swiper.css'\r\n\r\nVue.use(VueAwesomeSwiper, /* { default options with global component } */)\r\n```\r\n\r\n### Local Registration\r\n\r\n```javascript\r\nimport { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper'\r\n\r\n// import style (>= Swiper 6.x)\r\nimport 'swiper/swiper-bundle.css'\r\n\r\n// import style (<= Swiper 5.x)\r\nimport 'swiper/css/swiper.css'\r\n\r\nexport default {\r\n  components: {\r\n    Swiper,\r\n    SwiperSlide\r\n  },\r\n  directives: {\r\n    swiper: directive\r\n  }\r\n}\r\n```\r\n\r\n### CDN\r\n\r\n``` html\r\n<link rel=\"stylesheet\" href=\"path/to/swiper.css\"/>\r\n<script type=\"text/javascript\" src=\"path/to/swiper.js\"></script>\r\n<script type=\"text/javascript\" src=\"path/to/vue.min.js\"></script>\r\n<script type=\"text/javascript\" src=\"path/to/dist/vue-awesome-swiper.js\"></script>\r\n<script type=\"text/javascript\">\r\n  Vue.use(window.VueAwesomeSwiper)\r\n</script>\r\n```\r\n\r\n---\r\n\r\n### Difference with usage\r\n\r\n**Directive and the only difference in the use of the Component:**\r\n- `component` find Swiper instance by [`ref attribute`](https://vuejs.org/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements).\r\n- `directive` find Swiper instance by [`directive arg`](https://vuejs.org/v2/guide/custom-directive.html#Dynamic-Directive-Arguments).\r\n\r\nOther configurations, events are the same. \r\n\r\nThe effect of the two ways and the difference in the applicable environment [is here](https://github.com/surmon-china/surmon-china.github.io/blob/source/projects/vue-awesome-swiper/nuxt/).\r\n\r\n\r\n### Component\r\n\r\n```html\r\n<template>\r\n  <swiper ref=\"mySwiper\" :options=\"swiperOptions\">\r\n    <swiper-slide>Slide 1</swiper-slide>\r\n    <swiper-slide>Slide 2</swiper-slide>\r\n    <swiper-slide>Slide 3</swiper-slide>\r\n    <swiper-slide>Slide 4</swiper-slide>\r\n    <swiper-slide>Slide 5</swiper-slide>\r\n    <div class=\"swiper-pagination\" slot=\"pagination\"></div>\r\n  </swiper>\r\n</template>\r\n\r\n<script>\r\n  export default {\r\n    name: 'carrousel',\r\n    data() {\r\n      return {\r\n        swiperOptions: {\r\n          pagination: {\r\n            el: '.swiper-pagination'\r\n          },\r\n          // Some Swiper option/callback...\r\n        }\r\n      }\r\n    },\r\n    computed: {\r\n      swiper() {\r\n        return this.$refs.mySwiper.$swiper\r\n      }\r\n    },\r\n    mounted() {\r\n      console.log('Current Swiper instance object', this.swiper)\r\n      this.swiper.slideTo(3, 1000, false)\r\n    }\r\n  }\r\n</script>\r\n```\r\n\r\n\r\n### Directive\r\n\r\n```html\r\n<template>\r\n  <div v-swiper:mySwiper=\"swiperOption\">\r\n    <div class=\"swiper-wrapper\">\r\n      <div class=\"swiper-slide\" :key=\"banner\" v-for=\"banner in banners\">\r\n        <img :src=\"banner\">\r\n      </div>\r\n    </div>\r\n    <div class=\"swiper-pagination\"></div>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\n  export default {\r\n    data () {\r\n      return {\r\n        banners: [ '/1.jpg', '/2.jpg', '/3.jpg' ],\r\n        swiperOption: {\r\n          pagination: {\r\n            el: '.swiper-pagination'\r\n          },\r\n          // ...\r\n        }\r\n      }\r\n    },\r\n    mounted() {\r\n      console.log('Current Swiper instance object', this.mySwiper)\r\n      this.mySwiper.slideTo(3, 1000, false)\r\n    }\r\n  }\r\n</script>\r\n```\r\n\r\n---\r\n\r\n### Swiper component API\r\n\r\n```html\r\n<!-- All events/props support camelCase or kebab-case. -->\r\n<swiper\r\n  :options=\"swiperOptionsObject\"\r\n  :auto-update=\"true\"\r\n  :auto-destroy=\"true\"\r\n  :delete-instance-on-destroy=\"true\"\r\n  :cleanup-styles-on-destroy=\"true\"\r\n  @ready=\"handleSwiperReadied\"\r\n  @click-slide=\"handleClickSlide\"\r\n/>\r\n\r\n<!-- vue-awesome-swiper converts all Swiper events into component/directive events, e.g.: -->\r\n<swiper\r\n  @slide-change-transition-start=\"onSwiperSlideChangeTransitionStart\"\r\n  @slideChangeTransitionStart=\"onSwiperSlideChangeTransitionStart\"\r\n  @slideChangeTransitionEnd=\"...\"\r\n  @transitionStart=\"...\"\r\n  ...\r\n/>\r\n```\r\n```ts\r\ninterface IProps {\r\n  // Auto update swiper when vue component `updated`\r\n  autoUpdate?: boolean // default: true\r\n  // Auto destroy swiper when vue component 'beforeDestroy'\r\n  autoDestroy?: boolean // default: true\r\n\r\n  // swiper.destroy's params\r\n  // swiper.destroy(deleteInstanceOnDestroy, cleanupStylesOnDestroy)\r\n  deleteInstanceOnDestroy?: boolean // default: true\r\n  cleanupStylesOnDestroy?: boolean // default: true\r\n}\r\n\r\n// `@ready` event will emit when the Swiper instance mounted\r\nfunction handleSwiperReadied(swiper: Swiper) {\r\n  console.log('Swiper was munted!', swiper)\r\n}\r\n\r\n// `@click-slide` event has special treatment for Swiper's loop mode, which is still available in loop mode\r\nfunction handleClickSlide(index: number, reallyIndex: number | null) {\r\n  console.log('Click slide!', index, reallyIndex)\r\n}\r\n```\r\n\r\n### Swiper directive API\r\n\r\nBased on the exact same as the component API.\r\n\r\nIn the `directive` mode, the Swiper instance will be mounted in the parent's component context use the default name`$swiper`. In order to implement multiple swipers in a context, the `directive` has an additional name called `instanceName` API, through this API, you can easily control the name of each swiper mount context.\r\n\r\n```html\r\n<div v-swiper=\"swiperOptionsObject\" />\r\n<div v-swiper:secondSwiper=\"swiperOptionsObject\" />\r\n<div v-swiper:[dynamicSwiperName]=\"swiperOptionsObject\" />\r\n<div v-swiper=\"swiperOptionsObject\" instance-name=\"fourthSwiper\" />\r\n```\r\n```ts\r\nexport dafault {\r\n  data() {\r\n    return {\r\n      dynamicSwiperName: 'thirdSwiper'\r\n    }\r\n  },\r\n  mounted() {\r\n    console.log('Swiper instances:', this.$swiper, this.secondSwiper, this.thirdSwiper, this.fourthSwiper)\r\n  }\r\n}\r\n```\r\n\r\n### Swiper API\r\nSwiper's API and configuration can be used.\r\n\r\n- [EN Swiper events](https://swiperjs.com/api/#events)\r\n- [EN Swiper documentation](https://swiperjs.com/api/)\r\n- [ZH Swiper documentation](https://www.swiper.com.cn/api/index.html)\r\n\r\n---\r\n\r\n### [Custom Build with Swiper](https://swiperjs.com/api/#custom-build)\r\n\r\n```ts\r\nimport Vue from 'vue'\r\n// Swiper 5.x\r\nimport { Swiper as SwiperClass, Pagination, Mousewheel, Autoplay } from 'swiper/js/swiper.esm'\r\n// Swiper 6.x\r\nimport { Swiper as SwiperClass, Pagination, Mousewheel, Autoplay } from 'swiper/core'\r\n\r\nimport getAwesomeSwiper from 'vue-awesome-swiper/dist/exporter'\r\n\r\n// Swiper modules\r\nSwiperClass.use([Pagination, Mousewheel, Autoplay])\r\n\r\n// -------------------------------------------------\r\n\r\n// Global use\r\nVue.use(getAwesomeSwiper(SwiperClass))\r\n\r\n// -------------------------------------------------\r\n\r\n// Or local component\r\nconst { Swiper, SwiperSlide } = getAwesomeSwiper(SwiperClass)\r\nexport default {\r\n  components: {\r\n    Swiper,\r\n    SwiperSlide\r\n  }\r\n}\r\n```\r\n\r\n### Custom Swiper plugin\r\n\r\n```javascript\r\nimport SwiperClass from 'swiper'\r\n\r\nSwiperClass.use({\r\n  name: 'pluginName',\r\n  params: {\r\n    pluginSwitch: false,\r\n  },\r\n  on: {\r\n    init() {\r\n      if (!this.params.pluginSwitch) return\r\n      console.log('init')\r\n    },\r\n    // ...\r\n  }\r\n})\r\n\r\n// Your Swiper or App bussiness component...\r\n```\r\n---\r\n\r\n### Changelog\r\n\r\nDetailed changes for each release are documented in the [release notes](https://github.com/surmon-china/vue-awesome-swiper/blob/master/CHANGELOG.md).\r\n\r\n### License\r\n\r\n[MIT](https://github.com/surmon-china/vue-awesome-swiper/blob/master/LICENSE)\r\n","readmeFilename":"README.md"}