IOS,跳转后返回页面不刷新问题解决

在mounted中加入以下代码即可。

  mounted () {
    this.$nextTick(()=>{
    //首页跳转至门诊或者商城返回 IOS不兼容页面自动刷新问题
    var u = navigator.userAgent,
    app = navigator.appVersion;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
    var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if(isiOS){
      window.onpageshow = function(event) {
      if (event.persisted) {
          window.location.reload()
      }
      };
    }
    })
  },
原文地址:https://www.cnblogs.com/fkcqwq/p/13985295.html