Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiper组件 - SwiperProps.displayMultipleItems属性无法实现响应式更新 #11765

Closed
ittat opened this issue May 6, 2022 · 1 comment
Closed
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@ittat
Copy link

ittat commented May 6, 2022

相关平台

H5,小程序

浏览器版本: Chrome 100
使用框架: React

复现步骤

/* eslint-disable jsx-quotes */
import { Component } from "react";
import { View, Swiper, SwiperItem, Button } from "@tarojs/components";
import "./index.less";

export default class Index extends Component {
  state = {
    count:1,
  };


  oncountAdd(){
    this.setState({
      count:this.state.count + 1
    })
  }

  render() {
    return (
      <>
      <Button  onClick={()=>this.oncountAdd()}>点击增加displayMultipleItems</Button>
        <Swiper
          className='test-h'
          indicatorColor='#999'
          indicatorActiveColor='#333'
          // vertical
          // circular
          indicatorDots
          displayMultipleItems={this.state.count}
          autoplay>
          <SwiperItem>
            <View className='demo-text-1'>1</View>
          </SwiperItem>
          <SwiperItem>
            <View className='demo-text-2'>2</View>
          </SwiperItem>
          <SwiperItem>
            <View className='demo-text-3'>3</View>
          </SwiperItem>
        </Swiper>
      </>
    );
  }
}

期望结果

点击按钮,Swiper 显示item个数会增加

实际结果

没有变化

环境信息

👽 Taro v3.4.7

  Taro CLI 3.4.7 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.18.1 - D:\Program Files\nodejs\node.EXE
      npm: 6.14.15 - D:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels May 6, 2022
@ittat ittat changed the title Swiper组件 - SwiperProps.displayMultipleItems属性在H5端无法实现响应式更新 Swiper组件 - SwiperProps.displayMultipleItems属性在无法实现响应式更新 May 6, 2022
@ittat ittat changed the title Swiper组件 - SwiperProps.displayMultipleItems属性在无法实现响应式更新 Swiper组件 - SwiperProps.displayMultipleItems属性无法实现响应式更新 May 9, 2022
@ZakaryCode ZakaryCode added this to the 3.6.0 milestone Jan 29, 2023
@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
@fenglianhua
Copy link

RN displayMultipleItems不生效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants