点击事件打开到别的页面

	const env = process.env.API_ENV
    window.open(`${env === 'prod' ? 'https' : 'http'}://www.baidu.com`);

1.1

    const tempWindow = window.open('_black');
    tempWindow.location = 'http://www.baidu.com'
const a = document.createElement.('a');
a.href = 'https://www.baidu.com';
a.target = '_black';
a.click();

你可能感兴趣的:(js)