swiperjs 初始化后可以修改 slidesPerView 的个数吗?

Can you modify the number of slidesPerView in swiperjs after it was init?

我正在尝试在 swiperjs 启动后修改每个视图的幻灯片数量。 在 API 中,我找不到任何可以更新它的方法。 目前,滑动器是用每个视图 1 张幻灯片创建的,我想在启动后将其更改为每个视图 3 张幻灯片。

我怎样才能做到这一点?

通过修改参数解决。

let params = swiperModify.params;
params.slidesPerView = 3;
params.slidesPerColumn = 3;

出于某种原因,起初我一直在寻找一种方法来处理新参数(设置方法)..但这工作得很好。如果那不是最佳实践,我想知道:)