File tree Expand file tree Collapse file tree 4 files changed +25
-13
lines changed Expand file tree Collapse file tree 4 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -1521,7 +1521,7 @@ Customize table column so it can be integrated with other components.
1521
1521
### Table with custom header
1522
1522
1523
1523
Customize table header so it can be even more customized.
1524
- :::demo You can customize how the header looks by [ Default slot content ] ( https://vuejs.org/v2/guide/components-slots.html#Default-Slot-Content ) .
1524
+ :::demo You can customize how the header looks by header [ scoped slots ] ( https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots ) .
1525
1525
``` html
1526
1526
<template >
1527
1527
<el-table
@@ -1537,7 +1537,7 @@ Customize table header so it can be even more customized.
1537
1537
</el-table-column >
1538
1538
<el-table-column
1539
1539
align =" right" >
1540
- <template slot =" header" slot-scope =" slot " >
1540
+ <template slot =" header" slot-scope =" scope " >
1541
1541
<el-input
1542
1542
v-model =" search"
1543
1543
size =" mini"
@@ -1581,8 +1581,12 @@ Customize table header so it can be even more customized.
1581
1581
}
1582
1582
},
1583
1583
methods: {
1584
- handleEdit (){},
1585
- handleDelete (){}
1584
+ handleEdit (index , row ) {
1585
+ console .log (index, row);
1586
+ },
1587
+ handleDelete (index , row ) {
1588
+ console .log (index, row);
1589
+ }
1586
1590
},
1587
1591
}
1588
1592
</script >
Original file line number Diff line number Diff line change @@ -1520,7 +1520,7 @@ Personalice la columna de la tabla para que pueda integrarse con otros component
1520
1520
### Table with custom header
1521
1521
1522
1522
Customize table header so it can be even more customized.
1523
- :::demo You can customize how the header looks by [ Default slot content ] ( https://vuejs.org/v2/guide/components-slots.html#Default-Slot-Content ) .
1523
+ :::demo You can customize how the header looks by header [ scoped slots ] ( https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots ) .
1524
1524
``` html
1525
1525
<template >
1526
1526
<el-table
@@ -1536,7 +1536,7 @@ Customize table header so it can be even more customized.
1536
1536
</el-table-column >
1537
1537
<el-table-column
1538
1538
align =" right" >
1539
- <template slot =" header" slot-scope =" slot " >
1539
+ <template slot =" header" slot-scope =" scope " >
1540
1540
<el-input
1541
1541
v-model =" search"
1542
1542
size =" mini"
@@ -1580,8 +1580,12 @@ Customize table header so it can be even more customized.
1580
1580
}
1581
1581
},
1582
1582
methods: {
1583
- handleEdit (){},
1584
- handleDelete (){}
1583
+ handleEdit (index , row ) {
1584
+ console .log (index, row);
1585
+ },
1586
+ handleDelete (index , row ) {
1587
+ console .log (index, row);
1588
+ }
1585
1589
},
1586
1590
}
1587
1591
</script >
Original file line number Diff line number Diff line change 1686
1686
</el-table-column >
1687
1687
<el-table-column
1688
1688
align =" right" >
1689
- <template slot =" header" slot-scope =" slot " >
1689
+ <template slot =" header" slot-scope =" scope " >
1690
1690
<el-input
1691
1691
v-model =" search"
1692
1692
size =" mini"
1693
- placeholder =" Type to search " />
1693
+ placeholder =" 输入关键字搜索 " />
1694
1694
</template >
1695
1695
<template slot-scope =" scope" >
1696
1696
<el-button
1730
1730
}
1731
1731
},
1732
1732
methods: {
1733
- handleEdit (){},
1734
- handleDelete (){}
1733
+ handleEdit (index , row ) {
1734
+ console .log (index, row);
1735
+ },
1736
+ handleDelete (index , row ) {
1737
+ console .log (index, row);
1738
+ }
1735
1739
},
1736
1740
}
1737
1741
</script >
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ export default {
453
453
if ( this . type === 'selection' ) {
454
454
console . warn ( '[Element Warn][TableColumn]Selection column doesn\'t allow to set scoped-slot header.' ) ;
455
455
} else {
456
- this . columnConfig . renderHeader = this . $scopedSlots . header ;
456
+ this . columnConfig . renderHeader = ( h , scope ) => this . $scopedSlots . header ( scope ) ;
457
457
}
458
458
}
459
459
You can’t perform that action at this time.
0 commit comments