[英]Vue router keep-alive and mounted behavior
I had some logic in the mounted()
method before I started using <keep-alive>
.在我开始使用
<keep-alive>
之前,我在mounted()
方法中有一些逻辑。 For instance: document.title = this.title
.例如:
document.title = this.title
。 Now the title changes upon the first load only.现在标题仅在第一次加载时更改。
I could listen for route changes, but it won't work when you land on the page.我可以监听路线变化,但是当你登陆页面时它就不起作用了。
What is the proper way to detect loading of another component in <keep-alive>
?检测
<keep-alive>
中另一个组件的加载的正确方法是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.