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
404db2fb
Unverified
Commit
404db2fb
authored
Dec 07, 2020
by
Heresy
Committed by
GitHub
Dec 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): fix unsuccessful saving of row edit table (#117)
Co-authored-by:
heresy
<
Heresy@chxian.com
>
parent
59ad8244
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
renderEditable.tsx
src/components/Table/src/components/renderEditable.tsx
+19
-3
No files found.
src/components/Table/src/components/renderEditable.tsx
View file @
404db2fb
...
...
@@ -7,7 +7,7 @@ import { RenderEditableCellParams } from '../types/table';
import
{
ComponentType
}
from
'
../types/componentType
'
;
import
{
componentMap
}
from
'
../componentMap
'
;
import
{
isString
,
isBoolean
}
from
'
/@/utils/is
'
;
import
{
isString
,
isBoolean
,
isArray
}
from
'
/@/utils/is
'
;
import
{
FormOutlined
,
CloseOutlined
,
CheckOutlined
}
from
'
@ant-design/icons-vue
'
;
const
prefixCls
=
'
editable-cell
'
;
...
...
@@ -50,6 +50,7 @@ const EditableCell = defineComponent({
},
placeholder
:
{
type
:
String
as
PropType
<
string
>
,
default
:
''
,
},
},
emits
:
[
'
submit
'
,
'
cancel
'
],
...
...
@@ -92,9 +93,22 @@ const EditableCell = defineComponent({
if
(
props
.
record
)
{
/* eslint-disable */
props
.
record
.
onCancel
=
handleCancel
;
isArray
(
props
.
record
.
submitCbs
)
?
props
.
record
.
submitCbs
.
push
(
handleSubmit
)
:
(
props
.
record
.
submitCbs
=
[
handleSubmit
]);
/* eslint-disable */
isArray
(
props
.
record
.
cancelCbs
)
?
props
.
record
.
cancelCbs
.
push
(
handleCancel
)
:
(
props
.
record
.
cancelCbs
=
[
handleCancel
]);
/* eslint-disable */
props
.
record
.
onCancel
=
()
=>
{
isArray
(
props
.
record
?.
cancelCbs
)
&&
props
.
record
?.
cancelCbs
.
forEach
((
fn
)
=>
fn
());
};
/* eslint-disable */
props
.
record
.
onSubmit
=
handleSubmit
;
props
.
record
.
onSubmit
=
()
=>
{
isArray
(
props
.
record
?.
submitCbs
)
&&
props
.
record
?.
submitCbs
.
forEach
((
fn
)
=>
fn
());
};
}
function
handleSubmit
()
{
...
...
@@ -222,4 +236,6 @@ export type EditRecordRow<T = { [key: string]: any }> = {
editable
:
boolean
;
onCancel
:
Fn
;
onSubmit
:
Fn
;
submitCbs
:
Fn
[];
cancelCbs
:
Fn
[];
}
&
T
;
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