Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
9c32f558
Commit
9c32f558
authored
Nov 01, 2018
by
hetech
Committed by
GitHub
Nov 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table: fix header scoped slot not accessing data (#13263)
parent
f33a6562
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
examples/docs/en-US/table.md
examples/docs/en-US/table.md
+8
-4
examples/docs/es/table.md
examples/docs/es/table.md
+8
-4
examples/docs/zh-CN/table.md
examples/docs/zh-CN/table.md
+8
-4
packages/table/src/table-column.js
packages/table/src/table-column.js
+1
-1
No files found.
examples/docs/en-US/table.md
View file @
9c32f558
...
...
@@ -1521,7 +1521,7 @@ Customize table column so it can be integrated with other components.
### Table with custom header
Customize table header so it can be even more customized.
:::demo You can customize how the header looks by
[
Default slot content
](
https://vuejs.org/v2/guide/components-slots.html#Default-Slot-Content
)
.
:::demo You can customize how the header looks by
header
[
scoped slots
](
https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots
)
.
```
html
<template>
<el-table
...
...
@@ -1537,7 +1537,7 @@ Customize table header so it can be even more customized.
</el-table-column>
<el-table-column
align=
"right"
>
<template
slot=
"header"
slot-scope=
"s
lot
"
>
<template
slot=
"header"
slot-scope=
"s
cope
"
>
<el-input
v-model=
"search"
size=
"mini"
...
...
@@ -1581,8 +1581,12 @@ Customize table header so it can be even more customized.
}
},
methods
:
{
handleEdit
(){},
handleDelete
(){}
handleEdit
(
index
,
row
)
{
console
.
log
(
index
,
row
);
},
handleDelete
(
index
,
row
)
{
console
.
log
(
index
,
row
);
}
},
}
</script>
...
...
examples/docs/es/table.md
View file @
9c32f558
...
...
@@ -1520,7 +1520,7 @@ Personalice la columna de la tabla para que pueda integrarse con otros component
### Table with custom header
Customize table header so it can be even more customized.
:::demo You can customize how the header looks by
[
Default slot content
](
https://vuejs.org/v2/guide/components-slots.html#Default-Slot-Content
)
.
:::demo You can customize how the header looks by
header
[
scoped slots
](
https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots
)
.
```
html
<template>
<el-table
...
...
@@ -1536,7 +1536,7 @@ Customize table header so it can be even more customized.
</el-table-column>
<el-table-column
align=
"right"
>
<template
slot=
"header"
slot-scope=
"s
lot
"
>
<template
slot=
"header"
slot-scope=
"s
cope
"
>
<el-input
v-model=
"search"
size=
"mini"
...
...
@@ -1580,8 +1580,12 @@ Customize table header so it can be even more customized.
}
},
methods
:
{
handleEdit
(){},
handleDelete
(){}
handleEdit
(
index
,
row
)
{
console
.
log
(
index
,
row
);
},
handleDelete
(
index
,
row
)
{
console
.
log
(
index
,
row
);
}
},
}
</script>
...
...
examples/docs/zh-CN/table.md
View file @
9c32f558
...
...
@@ -1686,11 +1686,11 @@
</el-table-column>
<el-table-column
align=
"right"
>
<template
slot=
"header"
slot-scope=
"s
lot
"
>
<template
slot=
"header"
slot-scope=
"s
cope
"
>
<el-input
v-model=
"search"
size=
"mini"
placeholder=
"
Type to search
"
/>
placeholder=
"
输入关键字搜索
"
/>
</template>
<template
slot-scope=
"scope"
>
<el-button
...
...
@@ -1730,8 +1730,12 @@
}
},
methods
:
{
handleEdit
(){},
handleDelete
(){}
handleEdit
(
index
,
row
)
{
console
.
log
(
index
,
row
);
},
handleDelete
(
index
,
row
)
{
console
.
log
(
index
,
row
);
}
},
}
</script>
...
...
packages/table/src/table-column.js
View file @
9c32f558
...
...
@@ -453,7 +453,7 @@ export default {
if
(
this
.
type
===
'
selection
'
)
{
console
.
warn
(
'
[Element Warn][TableColumn]Selection column doesn
\'
t allow to set scoped-slot header.
'
);
}
else
{
this
.
columnConfig
.
renderHeader
=
this
.
$scopedSlots
.
header
;
this
.
columnConfig
.
renderHeader
=
(
h
,
scope
)
=>
this
.
$scopedSlots
.
header
(
scope
)
;
}
}
...
...
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