init : 初始化

This commit is contained in:
clay
2023-11-04 21:50:12 +08:00
commit 26eaa1a9b1
248 changed files with 36951 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { useDebounce } from "../utils/publicvoid"
let dom
export const fixedHeight = (el, binding, vnode) => {
dom = el
// 获取相对距离
const relativeObj = el.getBoundingClientRect()
// 获取网页高度
const clientHeight = document.body.clientHeight
// 70为分页器高度
el.style.height = (clientHeight - relativeObj.top - 70) + 'px'
el.style.overflow = 'auto'
}
window.addEventListener('resize',()=>{
const resizeHeight = useDebounce(fixedHeight(dom),2000,false)
resizeHeight()
})