1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <div class="swiper-container">
- <div class="swiper-wrapper">
- <slot></slot>
- </div>
- </div>
- </template>
-
- <script>
- import Swiper from 'swiper'
- // import SwiperCore, { Autoplay, Pagination } from 'swiper/core'
-
- // SwiperCore.use([Autoplay, Pagination])
-
- export default {
- name: 'Swiper',
- props: {
- options: {
- type: Object,
- default: () => ({})
- }
- },
- data() {
- return {
- swiper: undefined
- }
- },
- mounted() {
- this.$nextTick(() => {
- this.swiper = new Swiper(this.$el, this.options)
- })
- }
- }
- </script>
-
- <style>
- .swiper-container {
- width: 100%;
- height: 100%;
- }
- </style>
|