Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/416.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 多行swiper不工作,请从swiper.js作出反应_Javascript_Reactjs_Swiper - Fatal编程技术网

Javascript 多行swiper不工作,请从swiper.js作出反应

Javascript 多行swiper不工作,请从swiper.js作出反应,javascript,reactjs,swiper,Javascript,Reactjs,Swiper,我想从react中的swiper.js创建多行滑块。我无法通过他们在文件中提供的内容实现这一点。下面是我想从swiper.js创建的github repo 如何解决这个问题我也遇到过同样的问题。这是对我有效的解决方案。在您的刷卡器上包括slidesPerColumnFill=“row”。它将像: body { background: #eee; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size:

我想从react中的swiper.js创建多行滑块。我无法通过他们在文件中提供的内容实现这一点。下面是我想从swiper.js创建的github repo
如何解决这个问题

我也遇到过同样的问题。这是对我有效的解决方案。在您的刷卡器上包括
slidesPerColumnFill=“row”
。它将像:

body {
  background: #eee;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #000;
  margin: 0;
  padding: 0;
}

.swiper-container {
  width: 100%;
  height: 100%;
  margin-left: auto;
  margin-right: auto;
}

.swiper-slide {
  width: 300px;
  height: 300px;
}

.swiper-slide img {
  width: 100%;
}


对我也有用,谢谢!
body {
  background: #eee;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #000;
  margin: 0;
  padding: 0;
}

.swiper-container {
  width: 100%;
  height: 100%;
  margin-left: auto;
  margin-right: auto;
}

.swiper-slide {
  width: 300px;
  height: 300px;
}

.swiper-slide img {
  width: 100%;
}

<Swiper
  slidesPerView={3} // or 'auto'
  slidesPerColumn={2}
  slidesPerGroup={3}
  spaceBetween={5}
  slidesPerColumnFill="row"
  grabCursor={true}
  autoplay={{ delay: 3000 }}
  navigation
>