Functions
addClass
- addClass(obj: any, cls: string): void
calLongestCommonSubsequence
- calLongestCommonSubsequence(aStr: any, bStr: any): number
-
Parameters
Returns number
长度
calLongestCommonSubstring
- calLongestCommonSubstring(aStr: any, bStr: any): number
-
Parameters
Returns number
长度
camelCase2Underscore
- camelCase2Underscore(camelCase: string): string
-
Parameters
Returns string
camelCaseToKebabCase
- camelCaseToKebabCase(camelCase: string): string
-
Parameters
Returns string
cancelBubble
- cancelBubble(e: any): void
clearHtml
- clearHtml(string?: string): string
-
Parameters
-
Default value string: string = ""
Returns string
字符串
compatibleExist
- compatibleExist(instance: string, replaceStr: string): string
-
Parameters
-
instance: string
-
replaceStr: string
Returns string
cutCHSString
- cutCHSString(str?: string, len?: number, hasDot?: boolean): string
-
Parameters
-
Default value str: string = ""
-
Default value len: number = str.length
-
Default value hasDot: boolean = false
Returns string
返回截取后的字符串
debounce
- debounce(func: any, wait: number, immediate: any): (Anonymous function)
-
Parameters
-
func: any
-
wait: number
-
immediate: any
Returns (Anonymous function)
deepCopyObject
- deepCopyObject(obj: any): any
doFn
- doFn(fn: any, ...params: any[]): any
-
Parameters
-
fn: any
-
Rest ...params: any[]
Returns any
floatFixed
- floatFixed(num: any, size: any): string
-
Parameters
Returns string
floatToPercent
- floatToPercent(num: any, fixSize?: number): string
-
Parameters
-
num: any
-
Default value fixSize: number = 0
Returns string
friendlyInterval
- friendlyInterval(__namedParameters?: { end: number; start: number; type: string }): any
-
Parameters
-
Default value __namedParameters: { end: number; start: number; type: string } = {}
-
end: number
-
start: number
-
type: string
Returns any
取决于 type
generateRndNum
- generateRndNum(n: number): string
-
Parameters
Returns string
generateUniqueNum
- generateUniqueNum(n: number): string
-
Parameters
Returns string
getCookie
- getCookie(name: string): null | string
-
Parameters
Returns null | string
getDomain
- getDomain(__namedParameters?: { rules: string[]; url: string }): string
-
Parameters
-
Default value __namedParameters: { rules: string[]; url: string } = {}
-
rules: string[]
-
url: string
Returns string
getHashQueryParam
- getHashQueryParam(param: string): null | string
-
Parameters
Returns null | string
getLocalStorage
- getLocalStorage(key: string): any
-
Parameters
Returns any
返回值
getPerformance
- getPerformance(__namedParameters?: { camelCase: boolean }): Promise<unknown>
-
Parameters
-
Default value __namedParameters: { camelCase: boolean } = {}
Returns Promise<unknown>
加载数据
getQueryParam
- getQueryParam(name: string): null | string
-
Parameters
Returns null | string
getSearchQueryParam
- getSearchQueryParam(name: string): null | string
-
Parameters
Returns null | string
getSessionStorage
- getSessionStorage(key: string): any
-
Parameters
Returns any
返回值
getUrlParam
- getUrlParam(sUrl: string, sKey: string): any
-
Parameters
-
sUrl: string
-
sKey: string
Returns any
hasClass
- hasClass(obj: any, cls: string): boolean
-
Parameters
Returns boolean
inRate
- inRate(rate: number): boolean
-
Parameters
Returns boolean
true 命中
isJsonString
- isJsonString(str: string): boolean
-
Parameters
Returns boolean
isNumber
- isNumber(v: any): boolean
-
Parameters
Returns boolean
true 是数字
join
- join(joinStr: any, ...rest: any[]): string
-
Parameters
-
joinStr: any
-
Rest ...rest: any[]
Returns string
loadCSS
- loadCSS(__namedParameters?: { id: string; url: string }): Promise<unknown>
-
Parameters
-
Default value __namedParameters: { id: string; url: string } = {}
Returns Promise<unknown>
true -- 加载成功
loadScript
- loadScript(__namedParameters?: { id: string; isDefer: boolean; timeout: number; url: string; callback: any }): any
-
Parameters
-
Default value __namedParameters: { id: string; isDefer: boolean; timeout: number; url: string; callback: any } = {}
-
id: string
-
isDefer: boolean
-
timeout: number
-
url: string
-
callback: function
Returns any
-- true 成功
newLine
- newLine(str: string): string
-
Parameters
Returns string
removeClass
- removeClass(obj: any, cls: string): void
renderTable
- renderTable(tbID?: null, data?: never[], property?: never[]): void
-
Parameters
-
Default value tbID: null = null
-
Default value data: never[] = []
-
Default value property: never[] = []
Returns void
resetForm
- resetForm(...rest: any[]): void
setCookie
- setCookie(name: string, value: string, days: number, domain: string): void
-
Parameters
-
name: string
-
value: string
-
days: number
-
domain: string
Returns void
setLocalStorage
- setLocalStorage(key: string, value?: any): void
-
Parameters
-
key: string
-
Default value value: any = null
Returns void
setSessionStorage
- setSessionStorage(key: string, value?: any): void
-
Parameters
-
key: string
-
Default value value: any = null
Returns void
throttle
- throttle(func: any, wait: number, options: any): (Anonymous function)
-
Parameters
-
func: any
-
wait: number
-
options: any
Returns (Anonymous function)
trim
- trim(str: string): string
-
Parameters
Returns string
updateQueryStringParameter
- updateQueryStringParameter(uri: string, key: string, value: string): string
-
Parameters
-
uri: string
-
key: string
-
value: string
Returns string
addClass