|
@@ -11,3 +11,16 @@ app.use(createPinia())
|
|
app.use(router)
|
|
app.use(router)
|
|
app.use(ElementPlus)
|
|
app.use(ElementPlus)
|
|
app.mount('#app')
|
|
app.mount('#app')
|
|
|
|
+
|
|
|
|
+window.addEventListener('popstate', () => {
|
|
|
|
+ console.log('浏览器前进或后退触发 popstate');
|
|
|
|
+ window.location.reload();
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+// 监听 bfcache 恢复
|
|
|
|
+window.addEventListener('pageshow', (event) => {
|
|
|
|
+ if (event.persisted) {
|
|
|
|
+ console.log('页面从 bfcache 恢复');
|
|
|
|
+ window.location.reload();
|
|
|
|
+ }
|
|
|
|
+});
|