{"action":"created","issue":{"url":"https://api.github.com/repos/NervJS/taro/issues/1675","repository_url":"https://api.github.com/repos/NervJS/taro","labels_url":"https://api.github.com/repos/NervJS/taro/issues/1675/labels{/name}","comments_url":"https://api.github.com/repos/NervJS/taro/issues/1675/comments","events_url":"https://api.github.com/repos/NervJS/taro/issues/1675/events","html_url":"https://github.com/NervJS/taro/issues/1675","id":393955819,"node_id":"MDU6SXNzdWUzOTM5NTU4MTk=","number":1675,"title":"swiper circular","user":{"login":"LZY86","id":14832856,"node_id":"MDQ6VXNlcjE0ODMyODU2","avatar_url":"https://avatars1.githubusercontent.com/u/14832856?v=4","gravatar_id":"","url":"https://api.github.com/users/LZY86","html_url":"https://github.com/LZY86","followers_url":"https://api.github.com/users/LZY86/followers","following_url":"https://api.github.com/users/LZY86/following{/other_user}","gists_url":"https://api.github.com/users/LZY86/gists{/gist_id}","starred_url":"https://api.github.com/users/LZY86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LZY86/subscriptions","organizations_url":"https://api.github.com/users/LZY86/orgs","repos_url":"https://api.github.com/users/LZY86/repos","events_url":"https://api.github.com/users/LZY86/events{/privacy}","received_events_url":"https://api.github.com/users/LZY86/received_events","type":"User","site_admin":false},"labels":[{"id":1100883987,"node_id":"MDU6TGFiZWwxMTAwODgzOTg3","url":"https://api.github.com/repos/NervJS/taro/labels/H5%20%E7%BB%84%E4%BB%B6%E5%BA%93","name":"H5 组件库","color":"f99363","default":false},{"id":1109533556,"node_id":"MDU6TGFiZWwxMTA5NTMzNTU2","url":"https://api.github.com/repos/NervJS/taro/labels/answered","name":"answered","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":{"login":"jinjinjin0731","id":17409735,"node_id":"MDQ6VXNlcjE3NDA5NzM1","avatar_url":"https://avatars1.githubusercontent.com/u/17409735?v=4","gravatar_id":"","url":"https://api.github.com/users/jinjinjin0731","html_url":"https://github.com/jinjinjin0731","followers_url":"https://api.github.com/users/jinjinjin0731/followers","following_url":"https://api.github.com/users/jinjinjin0731/following{/other_user}","gists_url":"https://api.github.com/users/jinjinjin0731/gists{/gist_id}","starred_url":"https://api.github.com/users/jinjinjin0731/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinjinjin0731/subscriptions","organizations_url":"https://api.github.com/users/jinjinjin0731/orgs","repos_url":"https://api.github.com/users/jinjinjin0731/repos","events_url":"https://api.github.com/users/jinjinjin0731/events{/privacy}","received_events_url":"https://api.github.com/users/jinjinjin0731/received_events","type":"User","site_admin":false},"assignees":[{"login":"jinjinjin0731","id":17409735,"node_id":"MDQ6VXNlcjE3NDA5NzM1","avatar_url":"https://avatars1.githubusercontent.com/u/17409735?v=4","gravatar_id":"","url":"https://api.github.com/users/jinjinjin0731","html_url":"https://github.com/jinjinjin0731","followers_url":"https://api.github.com/users/jinjinjin0731/followers","following_url":"https://api.github.com/users/jinjinjin0731/following{/other_user}","gists_url":"https://api.github.com/users/jinjinjin0731/gists{/gist_id}","starred_url":"https://api.github.com/users/jinjinjin0731/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinjinjin0731/subscriptions","organizations_url":"https://api.github.com/users/jinjinjin0731/orgs","repos_url":"https://api.github.com/users/jinjinjin0731/repos","events_url":"https://api.github.com/users/jinjinjin0731/events{/privacy}","received_events_url":"https://api.github.com/users/jinjinjin0731/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-12-25T03:40:35Z","updated_at":"2019-03-25T14:29:55Z","closed_at":"2019-03-20T02:32:42Z","author_association":"NONE","body":"**问题描述**\r\nswiper无法实现无限轮播，轮播到最后一个item就停止了\r\n\r\n**复现步骤**\r\n[复现问题的步骤]\r\n1. 挂载之后，轮播到最后一个swiperItem之后，就终止了，onChange事件也不再触发了。\r\n2.有时候，自动轮播会失效，但是刷新之后就可以了。\r\n3.swiper组件(SwiperItem、Swiper、以及里面的Image)里面onClick，绑定不成功。\r\n\r\n[或者可以直接贴源代码，能贴文字就不要截图]\r\n\r\nimport { Component } from '@tarojs/taro'\r\nimport { Swiper, SwiperItem, Image, View } from '@tarojs/components'\r\nimport './UDSwiper.scss'\r\nimport { getGlobalData, setGlobalData } from \"../../utils/global_data\";\r\nimport { postIndexPageByBanner } from \"../../utils/request\";\r\n\r\nexport default class UDSwiper extends Component {\r\n\r\n    state = {\r\n        list: []\r\n    };\r\n\r\n    componentWillMount() {\r\n        let udSwiperList = getGlobalData('udSwiperList');\r\n        if (udSwiperList instanceof Array && udSwiperList.length > 0) {\r\n            this.start(udSwiperList)\r\n        } else {\r\n            postIndexPageByBanner({ sourceBanner: 'ST' }, resolve => {\r\n                if (!resolve.data instanceof Array) return\r\n                this.start(resolve.data);\r\n            });\r\n        }\r\n    }\r\n\r\n    componentDidMount() {\r\n\r\n    }\r\n\r\n    start(udSwiperList) {\r\n        setGlobalData('udSwiperList', udSwiperList);\r\n        this.setState({\r\n            list: udSwiperList\r\n        });\r\n    }\r\n\r\n    onClick = (e) => {\r\n        let href = e.target.parentNode.dataset.href;\r\n        if (href) {\r\n            window.location.href = href\r\n        }\r\n    };\r\n\r\n    render() {\r\n        let list = this.state.list.map(item => {\r\n            return (\r\n                <SwiperItem>\r\n                    <Image\r\n                        className='swiper__image'\r\n                        src={item.img}\r\n                        data-href={item.url}\r\n                    />\r\n                </SwiperItem>\r\n            )\r\n        });\r\n\r\n        return (\r\n            <View className='UDSwiper' onClick={this.onClick}>\r\n                <Swiper\r\n                    className={this.props.claz}\r\n                    indicatorColor='rgba(255, 255, 255, .5)'\r\n                    indicatorActiveColor='#fff'\r\n                    interval={1000}\r\n                    autoplay\r\n                    circular\r\n                    indicatorDots\r\n                >\r\n                    {list}\r\n                </Swiper>\r\n            </View>\r\n        )\r\n    }\r\n}\r\n\r\n\r\n**期望行为**\r\n\r\n1、实现循坏轮播\r\n2、swiper 的 onClick事件\r\n\r\n**报错信息**\r\n\r\n没有报错\r\n\r\n**系统信息**\r\n> Taro v1.2 及以上版本已添加 `taro info` 命令，方便大家查看系统及依赖信息，运行该命令后将结果贴下面即可。\r\n\r\n  Taro CLI 1.2.0 environment info:\r\n    System:\r\n      OS: macOS Sierra 10.12.6\r\n      Shell: 5.2 - /bin/zsh\r\n    Binaries:\r\n      Node: 10.10.0 - /usr/local/bin/node\r\n      npm: 6.4.1 - /usr/local/bin/npm\r\n\r\n**补充信息**\r\n[可选]\r\n[根据你的调查研究，出现这个问题的原因可能在哪里？]\r\n"},"comment":{"url":"https://api.github.com/repos/NervJS/taro/issues/comments/476221760","html_url":"https://github.com/NervJS/taro/issues/1675#issuecomment-476221760","issue_url":"https://api.github.com/repos/NervJS/taro/issues/1675","id":476221760,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NjIyMTc2MA==","user":{"login":"jinjinjin0731","id":17409735,"node_id":"MDQ6VXNlcjE3NDA5NzM1","avatar_url":"https://avatars1.githubusercontent.com/u/17409735?v=4","gravatar_id":"","url":"https://api.github.com/users/jinjinjin0731","html_url":"https://github.com/jinjinjin0731","followers_url":"https://api.github.com/users/jinjinjin0731/followers","following_url":"https://api.github.com/users/jinjinjin0731/following{/other_user}","gists_url":"https://api.github.com/users/jinjinjin0731/gists{/gist_id}","starred_url":"https://api.github.com/users/jinjinjin0731/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinjinjin0731/subscriptions","organizations_url":"https://api.github.com/users/jinjinjin0731/orgs","repos_url":"https://api.github.com/users/jinjinjin0731/repos","events_url":"https://api.github.com/users/jinjinjin0731/events{/privacy}","received_events_url":"https://api.github.com/users/jinjinjin0731/received_events","type":"User","site_admin":false},"created_at":"2019-03-25T14:29:55Z","updated_at":"2019-03-25T14:29:55Z","author_association":"CONTRIBUTOR","body":"@smileying  需要更新到最新版本，如果有新还有问题，请新开 issue ，勿在旧的当中回复"}}
{"actor":{"display_login":"jinjinjin0731"}}