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

@varlet/touch-emulator,在桌面端体验不友好 #114

Closed
yexiaodong opened this issue Aug 1, 2021 · 8 comments
Closed

@varlet/touch-emulator,在桌面端体验不友好 #114

yexiaodong opened this issue Aug 1, 2021 · 8 comments

Comments

@yexiaodong
Copy link

安装@varlet/touch-emulator,并在main.js中导入:
import '@varlet/touch-emulator'

但是切换效果不理想:
希望效果:按住鼠标左键滑动时,切换
当前效果:按住鼠标左键滑动,然后松开,再次滑动才切换

@haoziqaq
Copy link
Member

haoziqaq commented Aug 1, 2021

pc文档右侧手机的部分就是通过这个包进行适配的结果,swipe的效果是你期望的效果么?

@haoziqaq
Copy link
Member

haoziqaq commented Aug 1, 2021

方便的话能否提供一个问题demo,可以发到我的邮箱。

@yexiaodong
Copy link
Author

测试例子:https://gitee.com/yexiaodong/do-vue-simple

@yexiaodong
Copy link
Author

是要PC文档右侧手机部分的效果

@haoziqaq
Copy link
Member

haoziqaq commented Aug 1, 2021

您是mac电脑么

@haoziqaq
Copy link
Member

haoziqaq commented Aug 1, 2021

如果您是mac电脑,img标签的图像在拖动时会有默认行为,会导致您现在出现的问题,touchmove事件被默认行为打断了
如下可以解决,如果是这个问题,就不是很好在某个组件里规避了,需要用户自行解决。

以下是您给出的demo下面的代码

.swipe-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  加入这行代码
  pointer-events: none;
}

@yexiaodong
Copy link
Author

可以了,非常感谢

@haoziqaq
Copy link
Member

haoziqaq commented Aug 1, 2021

不用客气~

@haoziqaq haoziqaq closed this as completed Aug 1, 2021
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

2 participants