Commit 23e0932883d148688cee5d24e09f2886a3f5aaeb
Committed by
GitHub
1 parent
8f2008ac
fix: 修复Description组件渲染function xxxx() { [native code] }的问题 (#1796)
* fix/description-render-prototype-methods * fix/description-render-prototype-methods
Showing
1 changed file
with
4 additions
and
1 deletions
src/components/Description/src/Description.vue
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | import type { DescriptionsProps } from 'ant-design-vue/es/descriptions/index'; |
4 | 4 | import type { CSSProperties } from 'vue'; |
5 | 5 | import type { CollapseContainerOptions } from '/@/components/Container/index'; |
6 | - import { defineComponent, computed, ref, unref } from 'vue'; | |
6 | + import { defineComponent, computed, ref, unref, toRefs } from 'vue'; | |
7 | 7 | import { get } from 'lodash-es'; |
8 | 8 | import { Descriptions } from 'ant-design-vue'; |
9 | 9 | import { CollapseContainer } from '/@/components/Container/index'; |
... | ... | @@ -121,6 +121,9 @@ |
121 | 121 | return null; |
122 | 122 | } |
123 | 123 | const getField = get(_data, field); |
124 | + if (getField && !toRefs(_data).hasOwnProperty(field)) { | |
125 | + return isFunction(render) ? render('', _data) : ''; | |
126 | + } | |
124 | 127 | return isFunction(render) ? render(getField, _data) : getField ?? ''; |
125 | 128 | }; |
126 | 129 | ... | ... |