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
c031163f
Commit
c031163f
authored
Jan 04, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): fix edit-table not work
parent
a2c89d2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
EditableCell.vue
...components/Table/src/components/editable/EditableCell.vue
+0
-6
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+4
-3
No files found.
src/components/Table/src/components/editable/EditableCell.vue
View file @
c031163f
...
@@ -148,16 +148,10 @@
...
@@ -148,16 +148,10 @@
});
});
watchEffect
(()
=>
{
watchEffect
(()
=>
{
console
.
log
(
'
======================
'
);
console
.
log
(
1
);
console
.
log
(
'
======================
'
);
defaultValueRef
.
value
=
props
.
value
;
defaultValueRef
.
value
=
props
.
value
;
});
});
watchEffect
(()
=>
{
watchEffect
(()
=>
{
console
.
log
(
'
======================
'
);
console
.
log
(
2
);
console
.
log
(
'
======================
'
);
const
{
editable
}
=
props
.
column
;
const
{
editable
}
=
props
.
column
;
if
(
isBoolean
(
editable
)
||
isBoolean
(
unref
(
getRowEditable
)))
{
if
(
isBoolean
(
editable
)
||
isBoolean
(
unref
(
getRowEditable
)))
{
isEdit
.
value
=
!!
editable
||
unref
(
getRowEditable
);
isEdit
.
value
=
!!
editable
||
unref
(
getRowEditable
);
...
...
src/components/Table/src/hooks/useColumns.ts
View file @
c031163f
...
@@ -117,7 +117,8 @@ export function useColumns(
...
@@ -117,7 +117,8 @@ export function useColumns(
}
}
const
{
ellipsis
}
=
unref
(
propsRef
);
const
{
ellipsis
}
=
unref
(
propsRef
);
columns
.
forEach
((
item
)
=>
{
const
cloneColumns
=
cloneDeep
(
columns
);
cloneColumns
.
forEach
((
item
)
=>
{
const
{
customRender
,
slots
}
=
item
;
const
{
customRender
,
slots
}
=
item
;
handleItem
(
handleItem
(
...
@@ -125,7 +126,7 @@ export function useColumns(
...
@@ -125,7 +126,7 @@ export function useColumns(
Reflect
.
has
(
item
,
'
ellipsis
'
)
?
!!
item
.
ellipsis
:
!!
ellipsis
&&
!
customRender
&&
!
slots
Reflect
.
has
(
item
,
'
ellipsis
'
)
?
!!
item
.
ellipsis
:
!!
ellipsis
&&
!
customRender
&&
!
slots
);
);
});
});
return
columns
;
return
c
loneC
olumns
;
});
});
const
getViewColumns
=
computed
(()
=>
{
const
getViewColumns
=
computed
(()
=>
{
...
@@ -152,7 +153,7 @@ export function useColumns(
...
@@ -152,7 +153,7 @@ export function useColumns(
column
.
customRender
=
renderEditCell
(
column
);
column
.
customRender
=
renderEditCell
(
column
);
}
}
});
});
return
viewC
olumns
;
return
c
olumns
;
});
});
watch
(
watch
(
...
...
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