解决异步加载window.open 被拦截

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/p3118601/article/details/80019557
                  on: {
                    click: () => {
                      var newTab=window.open('about:blank');
                      this.$http.post('/download/downfile',{title:params.row.title}).then(res => {
                        newTab.location = 'https://view.officeapps.live.com/op/view.aspx?src='+res;
                      })
                    }
                  }

在请求外部定义一个window对象

然后请求成功后重定义location

猜你喜欢

转载自blog.csdn.net/p3118601/article/details/80019557
今日推荐