This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {onBeforeUnmount} from "vue"; | |
let useKeyDown = (keyCombos) => { | |
let onKeyDown = (event) => { | |
let kc = keyCombos.find(kc => kc.key === event.key); | |
if(kc) { | |
kc.fn(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosInstance } from 'axios' | |
import { Button, notification } from 'ant-design-vue' | |
import { h } from 'vue' | |
/** | |
* 无http请求最大时长 | |
*/ | |
const EXPIRE_TIME = 24 * 3600 * 1000 // 24小时 | |
/** | |
* http请求最后活跃时间 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { unref, isRef, Ref, onUnmounted } from 'vue' | |
type IntersectTarget = Element | Ref | |
/** | |
* 采用Intersection Observer API 实现无限滚动 | |
* more_help: https://developer.mozilla.org/zh-CN/docs/Web/API/Intersection_Observer_API#intersection_observer_%E7%9A%84%E6%A6%82%E5%BF%B5%E5%92%8C%E7%94%A8%E6%B3%95 | |
* @author <[email protected]> | |
* @param target 目标元素,可在可增加列表末尾设置一个标志标签 | |
* @param callback 正在相交时执行回调,请注意!如果有一些耗时的操作需要执行,建议使用 Window.requestIdleCallback() 方法 | |
* @param options IntersectionObserver()构造函数的 options 对象,可选值参考:https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver/IntersectionObserver#%E5%8F%82%E6%95%B0 | |
*/ |