You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.4 KiB
63 lines
1.4 KiB
1 year ago
|
<template>
|
||
|
<el-table :data="tableData">
|
||
|
<el-table-column prop="date" label="Date"></el-table-column>
|
||
|
<el-table-column prop="name" label="Name" :filters="filters" :filter-method="filter_methods"></el-table-column>
|
||
|
<el-table-column prop="address" label="Address"></el-table-column>
|
||
|
</el-table>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: "Table_Demo13",
|
||
|
data() {
|
||
|
return {
|
||
|
tableData: [
|
||
|
{
|
||
|
date: "2016-05-03",
|
||
|
name: "Tom",
|
||
|
address: "No. 189, Grove St, Los Angeles"
|
||
|
},
|
||
|
{
|
||
|
date: "2016-05-04",
|
||
|
name: "Tom1",
|
||
|
address: "No. 1891, Grove St, Los Angeles"
|
||
|
},
|
||
|
{
|
||
|
date: "2016-05-05",
|
||
|
name: "Tom2",
|
||
|
address: "No. 1892, Grove St, Los Angeles"
|
||
|
},
|
||
|
{
|
||
|
date: "2016-05-06",
|
||
|
name: "Tom3",
|
||
|
address: "No. 1893, Grove St, Los Angeles"
|
||
|
},
|
||
|
],
|
||
|
filters: [
|
||
|
{text: "Tom", value: "Tom"},
|
||
|
{text: "Tom1", value: "Tom1"},
|
||
|
{text: "Tom2", value: "Tom2"},
|
||
|
{text: "Tom3", value: "Tom3"}
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
filter_methods(value, row, column) {
|
||
|
console.log('filter')
|
||
|
console.log(row)
|
||
|
console.log(column)
|
||
|
const property = column['property']
|
||
|
console.log(property)
|
||
|
console.log(value)
|
||
|
console.log(row[property])
|
||
|
return row[property] === value
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
</style>
|