页面跳转

1、click点击跳转

window.open(url, '_self');//本窗口打开
window.open(url, '_blank');//新窗口打开

2、a标签

Preface

3、promise浏览器跳转拦截

            var Link =window.open('about:blank')  //先打开窗口
            var params = Object.assign({
                'type':1,
            }, params);
            this.api.get('/police/case/excel/exportAll',{
                params: params
            }).then((res) => {
                let url = 'http://172.20.1.242:82/excel/'+res.url;
                Link.location = url  再跳转
            }).catch( (error) => {
                console.log(error);
            });

你可能感兴趣的:(页面跳转)