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

更新1.2.10版本后使用Swiper组件报错TypeError: Swipers is not a constructor #2075

Closed
Git-leaner opened this issue Jan 29, 2019 · 4 comments

Comments

@Git-leaner
Copy link


问题描述
[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]
JSX中使用使用swiper组件报错
Uncaught (in promise) TypeError: Swipers is not a constructor at Swiper.componentDidMount (index.js?a9b7:87) at eval (index.js?1e21:1584) at errorCatcher (index.js?1e21:1482) at eval (index.js?1e21:1583) at Array.forEach (<anonymous>) at flushMount (index.js?1e21:1579) at updateComponent (index.js?1e21:1666) at Route.forceUpdate (index.js?1e21:1762) at eval (index.js?e6ae:2515)
复现步骤
this.mySwiper = new Swipers(this.$el, opt)

[或者可以直接贴源代码,能贴文字就不要截图]

``<Swiper
className='swplist'
indicatorActiveColor='#333'
vertical={false}
circular={false}
onChange={this['swiptype']}
current={mediasel}
indicatorDots={false}
autoplay={false}>
{
mediatps.map((tp,idx)=>{
return (<SwiperItem className={'swipitem'}>
<View className={'booklist'}>
{list(idx)}

{pagectrl(idx)}
)
})}
}
`js
// 这里可以贴代码


**期望行为**
怎么解决?好几个页面都有用到swiper

**报错信息**



**系统信息**
$ taro info
👽 Taro v1.2.10

  Taro CLI 1.2.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 10.5.0 - D:\nodejs\node.EXE
      Yarn: 1.13.0 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 6.1.0 - D:\nodejs\npm.CMD

**补充信息**

@taro-bot
Copy link

taro-bot bot commented Jan 29, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Git-leaner Git-leaner changed the title TypeError: Swipers is not a constructor 更新1.2.10版本后使用Swiper组件报错TypeError: Swipers is not a constructor Jan 29, 2019
@tourze
Copy link
Contributor

tourze commented Jan 29, 2019

坐等官方发新版本修复这个问题

@luckyadam
Copy link
Member

升级到 1.2.11 试试

@yuche
Copy link
Contributor

yuche commented Apr 8, 2019

close via eeae33f

@yuche yuche closed this as completed Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants