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
在router核心文件内填写重定向配置,如{ path: "*", redirect: "/home" },重定向至home.vue。
在home.vue页面组件的created等初始化生命周期函数中写入window.location.href="指定网站"或window.open(指定网站)。
在APP.vue中的created生命周期函数中写入window.location.href="指定网站"或window.open(指定网站)。
在浏览器地址输入框输入
http://localhost:8080并按下回车。
结果:先执行home.vue生命周期函数created中的重定向代码。而其他相关逻辑则是先执行APP.vue生命周期created中的代码再执行home.vue中的逻辑。
What is expected?
执行APP.vue的重定向代码
What is actually happening?
执行home.vue中的重定向代码
home being mounted after App, its code gets executed later. This is normal but the order is definitely not something you should rely on to execute side effects
Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the
forum
, the
Discord server
or
StackOverflow
.