📜  vue router popstate - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:33.743000             🧑  作者: Mango

代码示例1
/* there is no such event in late 2021 in the vue router. 
 use the popstate event of the window instance instead. */
 
// vue lifecycle hook
created() {
    window.onpopstate = function(event: PopStateEvent) {
        event.preventDefault();
        // your logic goes here
    }
}