当前位置:   article > 正文

在react中使用swiper/react_react使用swiper

react使用swiper

参考链接:https://swiper6.vercel.app/react#usage

其实swiper中文文档很多api都是直接阔以用的,只是形式不一样

中文文档:https://www.swiper.com.cn/api/

安装:yarn add swiper@6

import { Swiper, SwiperSlide } from 'swiper/react'
import { sliderList } from './source'
import SwiperCore, { Pagination, Autoplay, Navigation } from 'swiper'
import styled from '@emotion/styled'

// Import Swiper styles
import 'swiper/swiper-bundle.css'
import { useEffect, useState } from 'react'

export const MaskingLeft = styled.div`
  left: ${(props) => `${-props.offset}px`};
`

export const MaskingRight = styled.div`
  right: ${(props) => `${-props.offset}px`};
`

// 另外加载其他附加模块,比如 Navigatio
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/133960
推荐阅读
相关标签
  

闽ICP备14008679号