提交 848dca89 编写于 作者: d-u-a's avatar d-u-a

fix: vue3 nvue swiper indicator-dots iOS 无效的问题

上级 58596383
...@@ -18,6 +18,8 @@ import { NVueComponentStyles } from '../utils' ...@@ -18,6 +18,8 @@ import { NVueComponentStyles } from '../utils'
import { flatVNode } from '../../helpers/flatVNode' import { flatVNode } from '../../helpers/flatVNode'
import { swiperProps } from '../../components/swiper' import { swiperProps } from '../../components/swiper'
const isAndroid = weex.config.env.platform.toLowerCase() === 'android'
const swiperStyles: NVueComponentStyles = [ const swiperStyles: NVueComponentStyles = [
{ {
'uni-swiper': { 'uni-swiper': {
...@@ -101,7 +103,7 @@ export default defineComponent({ ...@@ -101,7 +103,7 @@ export default defineComponent({
{...listeners} {...listeners}
> >
{swiperItems} {swiperItems}
<indicator class="uni-swiper-dots" styles={indicatorStyle} /> <indicator class="uni-swiper-dots" style={indicatorStyle} />
</slider> </slider>
</div> </div>
) )
...@@ -171,10 +173,10 @@ function useSwiperListeners( ...@@ -171,10 +173,10 @@ function useSwiperListeners(
state.currentChangeSource = 'autoplay' state.currentChangeSource = 'autoplay'
} }
// 解决 iOS change 事件早于 scrollend 的问题 // 解决 iOS change 事件早于 scrollend 的问题
if (weex.config.env.platform === 'iOS') { if (isAndroid) {
setTimeout(end, 50)
} else {
end() end()
} else {
setTimeout(end, 50)
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册