This file contains 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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
const validate = { | |
int: "整数格式", | |
number: "数字格式", | |
double: "浮点数格式", | |
require: "必填", | |
}; | |
const itValidate = (key: keyof typeof validate) => { | |
return validate[key]; | |
}; |
This file contains 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
a, | |
a:focus, | |
a:hover { | |
color: inherit; | |
outline: none; | |
text-decoration: none; | |
} | |
body { | |
height: 100%; |
This file contains 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
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
type N = Record<string, any>; | |
/** | |
* 严格的Exclude, 方便自动提示 | |
*/ | |
type ExcludeStrict<T, U extends T> = Exclude<T, U>; | |
/** | |
* 严格的Extract, 方便自动提示 | |
*/ | |
type ExtractStrict<T, U extends T> = Extract<T, U>; |
This file contains 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 Vue, { VNode, RenderContext, CreateElement } from "vue"; | |
declare global { | |
interface VueComponents { | |
[key: string]: | |
| Vue | |
| ((createElement: CreateElement, hack: RenderContext) => VNode) | |
| undefined; | |
} | |
interface Window { |
This file contains 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
// 对Date的扩展,将 Date 转化为指定格式的String | |
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, | |
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) | |
// 例子: | |
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 | |
// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 | |
/* | |
* 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, | |
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) |