vue进入页面只刷新一次

陷入死循环

 

mounted: function() { location.reload(); },

 

正确方法

1 mounted: function() {
2             if (location.href.indexOf("#reloaded") == -1) {
3                 location.href = location.href + "#reloaded";
4                 location.reload();
5             }
6         },

 

posted @ 2021-03-29 15:08  誌翔  阅读(3726)  评论(1编辑  收藏  举报