问题:打卡一个新窗口的时候 想自定义窗口名称而不是默认的一串串字符串
/**
*
* @param url 地址
* @param title 窗口名称
*/
function openWindow(url: string, title: string) { // ts
// function openWindow(url: string, title: string) { // js
const newWindow: any = window.open('about:blank', title);
newWindow.document.title = title;
let iframe = document.createElement('iframe');
iframe.src = url;
iframe.style.width = '100%';
iframe.style.height = '100vh';
iframe.style.margin = '0';
iframe.style.padding = '0';
iframe.style.overflow = 'hidden';
iframe.style.border = 'none';
newWindow.document.body.style.margin = '0';
newWindow.document.body.appendChild(iframe);
}
openWindow('www.baidu,.com','百度')