const calculateHeight = { inserted(el: any) { const nodeRect = el.getBoundingClientRect(); el.style.height = document.body.clientHeight - 2 - Math.ceil(nodeRect.top) + "px"; }, }; /** * @Description 自动计算dom高度 * @Author ZPFly * @Date 2021/11/5 20:19 */ export default calculateHeight;