From 23e0932883d148688cee5d24e09f2886a3f5aaeb Mon Sep 17 00:00:00 2001 From: chengj Date: Wed, 13 Apr 2022 19:44:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DDescription=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B8=B2=E6=9F=93function=20xxxx()=20{=20[native=20co?= =?UTF-8?q?de]=20}=E7=9A=84=E9=97=AE=E9=A2=98=20(#1796)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix/description-render-prototype-methods * fix/description-render-prototype-methods --- src/components/Description/src/Description.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Description/src/Description.vue b/src/components/Description/src/Description.vue index 17b8c74c..1238acc2 100644 --- a/src/components/Description/src/Description.vue +++ b/src/components/Description/src/Description.vue @@ -3,7 +3,7 @@ import type { DescriptionsProps } from 'ant-design-vue/es/descriptions/index'; import type { CSSProperties } from 'vue'; import type { CollapseContainerOptions } from '/@/components/Container/index'; - import { defineComponent, computed, ref, unref } from 'vue'; + import { defineComponent, computed, ref, unref, toRefs } from 'vue'; import { get } from 'lodash-es'; import { Descriptions } from 'ant-design-vue'; import { CollapseContainer } from '/@/components/Container/index'; @@ -121,6 +121,9 @@ return null; } const getField = get(_data, field); + if (getField && !toRefs(_data).hasOwnProperty(field)) { + return isFunction(render) ? render('', _data) : ''; + } return isFunction(render) ? render(getField, _data) : getField ?? ''; };