Browse Source
fix: 修复Description组件渲染function xxxx() { [native code] }的问题 (#1796)
* fix/description-render-prototype-methods
* fix/description-render-prototype-methods
pull/1820/head
chengj
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
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 ?? ''; |
|
|
|
}; |
|
|
|
|
|
|
|
|