话不多说,直接上代码:
使用路由提供的history对象
const {history} = this.props标签:const,domA,react,新窗口,打开,路由,history From: https://www.cnblogs.com/foreveronlymiss/p/16991800.html
const domA = document.createElement('a')
domA.href = history.createHref({
pathname: '/page/view-model', // 是你想要新窗口打开的路由页面地址
})
domA.target = '_blank'
domA.click()