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

路由history和scrollBehavior()函数的冲突 #3639

Closed
SILENCEXZL opened this issue Sep 19, 2021 · 3 comments
Closed

路由history和scrollBehavior()函数的冲突 #3639

SILENCEXZL opened this issue Sep 19, 2021 · 3 comments

Comments

@SILENCEXZL
Copy link

Version

3.5.2

Reproduction link

codesandbox.io

Steps to reproduce

const router = new VueRouter({
routes ,
mode:'history',
scrollBehavior() {
return {x:0,y:0}
}
})

What is expected?

在浏览器输入localhost:8080////// 可以正常访问

What is actually happening?

显示空白页,控制台报错:
Failed to execute 'replaceState' on 'History': A history state object with URL 'http:' cannot be created in a document with origin 'http://localhost:8081' and URL 'http://localhost:8081///////'."


困扰了我三天的一个问题,希望可以得到解决。是我的使用方式有问题,还是确实是个bug呢?

@posva
Copy link
Member

posva commented Sep 19, 2021

Duplicate of #2593

@posva posva closed this as completed Sep 19, 2021
@SILENCEXZL
Copy link
Author

oh,thanks.I didn't see that issue before.It seems that you know Chinese? @posva

@posva
Copy link
Member

posva commented Sep 27, 2021

Not yet 😆 Give it a few years

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