done 新建工序
This commit is contained in:
@@ -217,7 +217,7 @@ export function getTime(type) {
|
||||
export function debounce(func, wait, immediate) {
|
||||
let timeout, args, context, timestamp, result
|
||||
|
||||
const later = function() {
|
||||
const later = function () {
|
||||
// 据上一次触发时间间隔
|
||||
const last = +new Date() - timestamp
|
||||
|
||||
@@ -234,7 +234,7 @@ export function debounce(func, wait, immediate) {
|
||||
}
|
||||
}
|
||||
|
||||
return function(...args) {
|
||||
return function (...args) {
|
||||
context = this
|
||||
timestamp = +new Date()
|
||||
const callNow = immediate && !timeout
|
||||
@@ -438,3 +438,7 @@ export function toCamelCase(str, upperCaseFirst) {
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
export function IdToName(targetId, source, prop = 'name') {
|
||||
return source.find(item => item.id === targetId)?.[prop]
|
||||
}
|
||||
Reference in New Issue
Block a user