📅  最后修改于: 2022-03-11 14:57:05.239000             🧑  作者: Mango
const svg = document.querySelector('svg');
svg.style.height = `${window.innerHeight}px`;
window.addEventListener('resize', () => { // for every screen resize, the svg height remains 100% relative to the window height
svg.style.height = `${window.innerHeight}px`;
console.log(window.innerWidth)
});