update Table filter style

This commit is contained in:
梁灏 2018-06-25 20:22:57 +08:00
parent a000231ec2
commit 9f723b0257
2 changed files with 43 additions and 8 deletions

View file

@ -1,28 +1,61 @@
<template> <template>
<Table border :columns="columns5" :data="data5"></Table> <Table border :columns="columns6" :data="data5"></Table>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
columns5: [ columns6: [
{ {
title: 'Date', title: 'Date',
key: 'date', key: 'date'
sortable: true
}, },
{ {
title: 'Name', title: 'Name',
key: 'name' key: 'name'
}, },
{ {
title: 'Age', title: '年龄',
key: 'age', key: 'age',
sortable: true filters: [
{
label: 'Greater than 25',
value: 1
},
{
label: 'Less than 25',
value: 2
}
],
filterMultiple: false,
filterMethod (value, row) {
if (value === 1) {
return row.age > 25;
} else if (value === 2) {
return row.age < 25;
}
}
}, },
{ {
title: 'Address', title: 'Address',
key: 'address' key: 'address',
filters: [
{
label: 'New York',
value: 'New York'
},
{
label: 'London',
value: 'London'
},
{
label: 'Sydney',
value: 'Sydney'
}
],
filterMethod (value, row) {
return row.address.indexOf(value) > -1;
}
} }
], ],
data5: [ data5: [
@ -50,7 +83,7 @@
address: 'Ottawa No. 2 Lake Park', address: 'Ottawa No. 2 Lake Park',
date: '2016-10-04' date: '2016-10-04'
} }
] ],
} }
} }
} }

View file

@ -333,6 +333,8 @@
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
position: relative;
top: 1px;
i{ i{
color: @btn-disable-color; color: @btn-disable-color;