Leanote's Blog
I love Leanote!
Toggle navigation
Leanote's Blog
Home
Chrome
Git
Linux
Windows
Others
工具大全
VsCode
Expo
Html
JavaScript
Npm
Node
Mock
React-Native
React
TypeScript
小程序
插件
正则
Dva
Ant-Design-React
Umi
Vue
Vux
Ant-Design-Vue
Http
Java
flutter
开发小工具
About Me
Archives
Tags
Carousel走马灯,轮播图(antd V2.12.1添加左右切换按钮和跳转到指定位置)
2019-11-14 07:46:48
26
0
0
admin
### antd最新版可以使用next(), prev(), goTo() ### antd旧版使用refs.slick.slickNext(), refs.slick.slickPrev(), refs.slick.slickGoTo() next = ()=> { this.carouselRef.refs.slick.slickNext(); } prev = ()=> { console.log(this.carouselRef) this.carouselRef.refs.slick.slickPrev(); } render() {<div> {/** `注意` 这里onClick里的方法需放到外部使用, 不能直接在里面写this.carouselRef.refs.slick.slickPrev(), 因为这样获取不到this.carouselRef*/} (this.carouselRef = el)} > { fileList.map(item => { return <img src="{item.url}" alt="" data-mce-src="file:///E:/leanote-2.6.1/resources/app/{item.url}"> }) } {/** `注意` 这里onClick里的方法需放到外部使用, 不能直接在里面写this.carouselRef.refs.slick.slickNext(), 因为这样获取不到this.carouselRef*/} </div> }
Pre:
antd table使用总结
Next:
时间选择器
0
likes
26
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.