From 4246548552bd460e1e7ba16279a9f33d1dbe79df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=A6=82=E6=91=B8=E9=B1=BC=E5=8E=BB?= <1780903673@qq.com> Date: Thu, 24 Oct 2024 22:12:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E4=B8=8EisDef=E4=BA=92=E6=96=A5=E7=9A=84isNone=20(#68?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/uni_modules/wot-design-uni/components/common/util.ts | 4 ---- src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/uni_modules/wot-design-uni/components/common/util.ts b/src/uni_modules/wot-design-uni/components/common/util.ts index de23fa91..a638f49f 100644 --- a/src/uni_modules/wot-design-uni/components/common/util.ts +++ b/src/uni_modules/wot-design-uni/components/common/util.ts @@ -358,10 +358,6 @@ export function isNotUndefined(value: T): value is NotUndefined { return !isUndefined(value) } -export function isNone(value: any): value is null | undefined { - return value === null || value === void 0 -} - /** * 检查给定的值是否为奇数 * @param value 要检查的值 diff --git a/src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue b/src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue index dd36ba67..5b59ce36 100644 --- a/src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue +++ b/src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue @@ -63,7 +63,7 @@ import { useCell } from '../composables/useCell' import { useParent } from '../composables/useParent' import { FORM_KEY } from '../wd-form/types' import { cellProps } from './types' -import { isNone } from '../common/util' +import { isDef } from '../common/util' const props = defineProps(cellProps) const emit = defineEmits(['click']) @@ -71,7 +71,7 @@ const emit = defineEmits(['click']) const cell = useCell() const isBorder = computed(() => { - return Boolean(!isNone(props.border) ? props.border : cell.border.value) + return Boolean(isDef(props.border) ? props.border : cell.border.value) }) const { parent: form } = useParent(FORM_KEY)