Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个带有反应多轮播的轮播。到目前为止,这个包裹真的很棒,为我做了很多繁重的工作。我想我只是一件小事。是否有正确的方法在“customTransition”属性上为不同的设备类型设置不同的值?任何帮助将不胜感激。
您可以使用 react-device-detect lib 来确定设备类型
import { isMobile } from "react-device-detect"; ... <Carousel customTransition={ isMobile ? "yout custom transition for mobile" : "your custom transition for desktop" } >