"/login"
beforeCreate: function() {
alert("1")
},
created: function() {
alert("2")
},
beforeMount: function() {
alert("3")
},
mounted: function() {
alert("4")
},
methods: {
login() {
window.location.href=url
}
}
enter the "/ login" route normally, the lifecycle function can execute alert normally
Click the login button to jump to the external url, get some information from the external url, and then jump back to the "/ login" route from the external url, the page will open normally, but all the lifecycle functions will fail, and the alert will not be executed. What is the reason