Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
4909a4cb
Commit
4909a4cb
authored
Feb 04, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(descriotion): fix type #228
parent
1d0ec362
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
index.tsx
src/components/Description/src/index.tsx
+6
-2
types.ts
src/components/Description/src/types.ts
+1
-1
No files found.
src/components/Description/src/index.tsx
View file @
4909a4cb
import
type
{
DescOptions
,
DescInstance
,
DescItem
}
from
'
./types
'
;
import
{
defineComponent
,
computed
,
ref
,
unref
,
CSSProperties
}
from
'
vue
'
;
import
{
get
}
from
'
lodash-es
'
;
import
{
Descriptions
}
from
'
ant-design-vue
'
;
import
{
DescriptionsProps
}
from
'
ant-design-vue/es/descriptions/index
'
;
import
{
CollapseContainer
,
CollapseContainerOptions
}
from
'
/@/components/Container/index
'
;
...
...
@@ -91,8 +92,11 @@ export default defineComponent({
return
null
;
}
const
getContent
=
()
=>
isFunction
(
render
)
?
render
(
data
?.[
field
],
data
)
:
unref
(
data
)
&&
unref
(
data
)[
field
];
const
getContent
=
()
=>
{
const
_data
=
unref
(
data
);
const
getField
=
get
(
_data
,
field
);
return
isFunction
(
render
)
?
render
(
getField
,
_data
)
:
getField
??
''
;
};
const
width
=
contentMinWidth
;
return
(
...
...
src/components/Description/src/types.ts
View file @
4909a4cb
...
...
@@ -17,7 +17,7 @@ export interface DescItem {
// render
render
?:
(
val
:
string
,
data
:
Record
able
data
:
Record
<
string
,
any
>
)
=>
VNode
|
undefined
|
JSX
.
Element
|
Element
|
string
|
number
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment