From cd774ccc0c30ef18ffffde1489c944b641083b65 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Wed, 27 Sep 2023 20:26:50 +0800 Subject: [PATCH] wip: Waterfall --- src/components/Waterfall/src/Waterfall.vue | 55 ++++++++++++++++++++-- src/utils/propTypes.ts | 23 ++++++--- src/views/Components/Waterfall.vue | 8 +++- vite.config.ts | 3 +- 4 files changed, 77 insertions(+), 12 deletions(-) diff --git a/src/components/Waterfall/src/Waterfall.vue b/src/components/Waterfall/src/Waterfall.vue index 63d4374..01c8d5b 100644 --- a/src/components/Waterfall/src/Waterfall.vue +++ b/src/components/Waterfall/src/Waterfall.vue @@ -1,20 +1,67 @@ diff --git a/src/utils/propTypes.ts b/src/utils/propTypes.ts index e211c09..863f55c 100644 --- a/src/utils/propTypes.ts +++ b/src/utils/propTypes.ts @@ -1,11 +1,22 @@ -import VueTypes, { toType } from 'vue-types' -import { CSSProperties, PropType } from 'vue' +import { VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType } from 'vue-types' +import { CSSProperties } from 'vue' -class propTypes extends VueTypes { +type PropTypes = VueTypesInterface & { + readonly style: VueTypeValidableDef +} +const newPropTypes = createTypes({ + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + object: undefined, + integer: undefined +}) as PropTypes + +class propTypes extends newPropTypes { static get style() { - return toType('style', { - type: [String, Object] as PropType<[string | CSSProperties]>, - default: undefined + return toValidableType('style', { + type: [String, Object] }) } } diff --git a/src/views/Components/Waterfall.vue b/src/views/Components/Waterfall.vue index ac0a6b5..60fc3ad 100644 --- a/src/views/Components/Waterfall.vue +++ b/src/views/Components/Waterfall.vue @@ -28,6 +28,12 @@ const { t } = useI18n() diff --git a/vite.config.ts b/vite.config.ts index fac26c1..60c5363 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -151,7 +151,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { '@wangeditor/editor-for-vue', 'vue-json-pretty', '@zxcvbn-ts/core', - 'dayjs' + 'dayjs', + 'mockjs' ] } }