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

Dialog 的 onConfirm 方法中无法重定向页面地址 #9

Closed
LLoyou00 opened this issue Apr 28, 2018 · 5 comments
Closed

Dialog 的 onConfirm 方法中无法重定向页面地址 #9

LLoyou00 opened this issue Apr 28, 2018 · 5 comments

Comments

@LLoyou00
Copy link

RT

_20180428182057
如上图这样无法达到想要的效果,需要像注释的代码那样才能达到目的。

@deepkolos
Copy link
Owner

deepkolos commented Apr 28, 2018

我这边部分复现成功~ 请问你使用的浏览器版本是?
我的测试环境是win7 x64 chrome 67 和chrome 48和测试了安卓chrome 65 没复现成功

复现成功的是微信6.6的自带浏览器和TIM的自带浏览器

已经增加了页面测试
https://github.com/deepkolos/vc-popup/blob/master/example/pages/popup-dialog.vue#L31

@deepkolos
Copy link
Owner

@LLoyou00 话说, 想问问是否有必要增加, 在结束动画之后才出发onConfirm/onCancel的需求捏?

@deepkolos
Copy link
Owner

已经找到原因了

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>location.href bug</title>
</head>
<body>
    <div id="box">点击跳转到自然志</div>
</body>
<script>
    var $box = document.getElementById('box');
    location.hash = 'test'
    $box.addEventListener('click', function(){
        location.href = "https://ziranzhi.com/"
        console.log('here');
        history.back()
        location.href = 'fail'
    })
</script>
</html>

https://github.com/deepkolos/vc-popup/blob/master/src/components/popup-dialog/index.vue#L100

之前是后面close, 之前是后面再执行close, close里边会导致一个href设置

@LLoyou00
Copy link
Author

@deepkolos 好的
关于是否有必要增加, 在结束动画之后才出发onConfirm/onCancel的需求,我经验也不是很丰富,就不给意见了。

@LLoyou00
Copy link
Author

@deepkolos 问题好像并没有得到解决,我在两台安卓手机和一台 IOS8 上测试都无法跳转。
测试了 Chrome 没有这个问题,360Chrome 中问题依旧存在。

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