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

方法一: we码用了,生效 mounted () {this.$nextTick(()>{首页跳转至门诊或者商城返回 IOS不兼容页面自动刷新问题var unavigator.us

方法一: we码用了,生效

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()
      }
      };
    }
    })
  },

方法二:

mounted(){
    var _this = this;
    window.addEventListener('pageshow',function(){
      if(_this.isPageHide) {
        window.location.reload();
      }
    });
    window.addEventListener('pagehide', function(){
      _this.isPageHide = true;
    });
}

发布者:admin,转转请注明出处:http://www.yc00.com/web/1741054419a4298524.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信