From 548550bb42809f988476bf3c0fdb40a321be145a Mon Sep 17 00:00:00 2001
From: LiuHao <liuhaoai545@gmail.com>
Date: 星期二, 06 六月 2023 20:41:44 +0800
Subject: [PATCH] add propTypes工具以及vue-types
---
src/utils/propTypes.ts | 25 +++++++++++++++++++++++++
package.json | 5 +++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 71f62a2..3217898 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,8 @@
"vue": "3.2.45",
"vue-cropper": "1.0.3",
"vue-i18n": "9.2.2",
- "vue-router": "4.1.4"
+ "vue-router": "4.1.4",
+ "vue-types": "^5.0.3"
},
"devDependencies": {
"@iconify/json": "^2.2.40",
@@ -70,11 +71,11 @@
"unplugin-auto-import": "0.13.0",
"unplugin-icons": "0.15.1",
"unplugin-vue-components": "0.23.0",
+ "vite": "4.3.1",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vitest": "^0.29.7",
- "vite": "4.3.1",
"vue-eslint-parser": "9.1.0",
"vue-tsc": "0.35.0"
}
diff --git a/src/utils/propTypes.ts b/src/utils/propTypes.ts
new file mode 100644
index 0000000..4d69bb6
--- /dev/null
+++ b/src/utils/propTypes.ts
@@ -0,0 +1,25 @@
+import { CSSProperties } from 'vue';
+import { createTypes, VueTypeValidableDef, VueTypesInterface } from 'vue-types';
+
+type PropTypes = VueTypesInterface & {
+ readonly style: VueTypeValidableDef<CSSProperties>;
+};
+
+const propTypes = createTypes({
+ func: undefined,
+ bool: undefined,
+ string: undefined,
+ number: undefined,
+ object: undefined,
+ integer: undefined
+}) as PropTypes;
+
+propTypes.extend([
+ {
+ name: 'style',
+ getter: true,
+ type: [String, Object],
+ default: undefined
+ }
+]);
+export { propTypes };
--
Gitblit v1.9.3