一、需要用的外部文件统一存放在utils文件夹内
throttle.js 节流
// 节流
export const throttle = function (fn, delay) {
let preTime = Date.now()
return function () {
const context = this
const args = arguments
const nowTime = Date.now()
if (nowTime - preTime >= delay) {
preTime = nowTime
fn.apply(context, args)
}
}
}
constant.js 滚动加载到达底部的偏移量
// 滚动加载到达底部的偏移量
export const REACH_BOTTOM_DISTANCE = document.documentElement.clientHeight
二、使用方式 着重介绍js功能代码
<templete>
//省略html模块 具体展示形式根据需求 是table还是列表其他表现形式
</templete>
<script>
import { lotlistSearch } from "../../http"; //封装好的接口请求
import { REACH_BOTTOM_DISTANCE } from &#