From 2cd8222ab626578afa8b994421670db25e2e6688 Mon Sep 17 00:00:00 2001 From: inter Date: Mon, 8 Sep 2025 16:37:42 +0800 Subject: [PATCH] Add File --- frontend/src/utils/propTypes.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 frontend/src/utils/propTypes.ts diff --git a/frontend/src/utils/propTypes.ts b/frontend/src/utils/propTypes.ts new file mode 100644 index 0000000..94c53a4 --- /dev/null +++ b/frontend/src/utils/propTypes.ts @@ -0,0 +1,27 @@ +import { toType, createTypes, type VueTypesInterface, type VueTypeValidableDef } from 'vue-types' +import type { CSSProperties } from 'vue' + +// 自定义扩展vue-types +type PropTypes = VueTypesInterface & { + readonly style: VueTypeValidableDef +} + +const ProjectTypes = createTypes({ + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + object: undefined, + integer: undefined, +}) as PropTypes + +class propTypes extends ProjectTypes { + style() { + return toType('style', { + type: [String, Object], + default: undefined, + }) + } +} + +export { propTypes }