01 2023 档案
vue实现dom元素拉伸(转载)
摘要:一、实现效果封装了三个methods方法,传入对应节点即可实现对应元素节点的拉伸收缩。 二、代码1. 函数封装 /*** * 让指定的dom元素支持沿x轴的拉伸收缩 * oBox为指定的dom节点 * e为鼠标按键默认传入的对象 */ moveX(oBox, e) { let x = e.clien
阅读全文
防抖和节流
摘要:// 防抖函数和节流函数, 使用方法antiShaking(() => { // 执行动作 // }) let timer = null; //time用来控制事件的触发 // 防抖 export function antiShaking(functionItem, timerType = "tim
阅读全文