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
4500214b
Commit
4500214b
authored
Oct 13, 2020
by
nebv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix editable cells cannot be entered
parent
beb4c3a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
16 deletions
+10
-16
renderEditableCell.tsx
src/components/Table/src/components/renderEditableCell.tsx
+4
-4
Line.vue
src/views/demo/echarts/Line.vue
+2
-4
Map.vue
src/views/demo/echarts/Map.vue
+2
-4
Pie.vue
src/views/demo/echarts/Pie.vue
+2
-4
No files found.
src/components/Table/src/components/renderEditableCell.tsx
View file @
4500214b
...
...
@@ -43,7 +43,7 @@ const EditableCell = defineComponent({
const
elRef
=
ref
<
any
>
(
null
);
const
isEditRef
=
ref
(
false
);
const
currentValueRef
=
ref
<
string
|
boolean
>
(
''
);
const
currentValueRef
=
ref
<
string
|
boolean
>
(
props
.
value
);
function
handleChange
(
e
:
ChangeEvent
|
string
|
boolean
)
{
if
((
e
as
ChangeEvent
).
target
&&
Reflect
.
has
((
e
as
ChangeEvent
).
target
,
'
value
'
))
{
...
...
@@ -106,7 +106,7 @@ const EditableCell = defineComponent({
}}
style=
{
{
width
:
'
calc(100% - 48px)
'
}
}
ref=
{
elRef
}
value=
{
value
}
value=
{
unref
(
currentValueRef
)
}
size=
"small"
onChange=
{
handleChange
}
onPressEnter=
{
handleSubmit
}
...
...
@@ -141,12 +141,12 @@ export function renderEditableCell({
return
({
text
,
record
}:
{
text
:
string
;
record
:
any
})
=>
{
return
(
<
EditableCell
{
...
componentOn
}
{
...
componentProps
}
value=
{
text
}
dataKey=
{
record
.
key
}
dataIndex=
{
dataIndex
}
component=
{
component
}
on=
{
componentOn
}
componentProps=
{
componentProps
}
/>
);
};
...
...
src/views/demo/echarts/Line.vue
View file @
4500214b
<
template
>
<div
class=
"p-4"
>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</div>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
PropType
,
ref
,
Ref
,
onMounted
}
from
'
vue
'
;
...
...
@@ -18,7 +16,7 @@
},
height
:
{
type
:
String
as
PropType
<
string
>
,
default
:
'
80vh
'
,
default
:
'
calc(100vh - 78px)
'
,
},
},
setup
()
{
...
...
src/views/demo/echarts/Map.vue
View file @
4500214b
<
template
>
<div
class=
"p-4"
>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</div>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
PropType
,
ref
,
Ref
,
onMounted
}
from
'
vue
'
;
...
...
@@ -18,7 +16,7 @@
},
height
:
{
type
:
String
as
PropType
<
string
>
,
default
:
'
80vh
'
,
default
:
'
calc(100vh - 78px)
'
,
},
},
setup
()
{
...
...
src/views/demo/echarts/Pie.vue
View file @
4500214b
<
template
>
<div
class=
"p-4"
>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</div>
<div
ref=
"chartRef"
:style=
"
{ height, width }" />
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
PropType
,
ref
,
Ref
,
onMounted
}
from
'
vue
'
;
...
...
@@ -16,7 +14,7 @@
},
height
:
{
type
:
String
as
PropType
<
string
>
,
default
:
'
80vh
'
,
default
:
'
calc(100vh - 78px)
'
,
},
},
setup
()
{
...
...
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