optimize Table style

optimize Table style
This commit is contained in:
梁灏 2016-12-08 22:24:57 +08:00
parent f9d87766ca
commit e8ee1423e7
2 changed files with 8 additions and 30 deletions

View file

@ -1,7 +1,7 @@
// sortable // sortable
.sortable() { .sortable() {
display: inline-block; display: inline-block;
width: 8px; width: 9px;
height: 12px; height: 12px;
margin-left: 4px; margin-left: 4px;
margin-top: -1px; margin-top: -1px;

View file

@ -1,38 +1,27 @@
<template> <template>
<i-table border :content="self" :columns="columns7" :data="data6"></i-table> <i-table :columns="columns1" :data="data1"></i-table>
<i-table size="small" :columns="columns1" :data="data1"></i-table>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
self: this, columns1: [
columns7: [
{ {
title: '姓名', title: '姓名',
key: 'name', key: 'name'
render (row, column, index) {
return `<Icon type="person"></Icon> <strong>${row.name}</strong>`;
}
}, },
{ {
title: '年龄', title: '年龄',
key: 'age' key: 'age',
sortable: true
}, },
{ {
title: '地址', title: '地址',
key: 'address' key: 'address'
},
{
title: '操作',
key: 'action',
width: 150,
align: 'center',
render (row, column, index) {
return `<i-button type="primary" size="small" @click="show(${index})">查看</i-button> <i-button type="error" size="small" @click="remove(${index})">删除</i-button>`;
}
} }
], ],
data6: [ data1: [
{ {
name: '王小明', name: '王小明',
age: 18, age: 18,
@ -55,17 +44,6 @@
} }
] ]
} }
},
methods: {
show (index) {
this.$Modal.info({
title: '用户信息',
content: `姓名:${this.data6[index].name}<br>年龄:${this.data6[index].age}<br>地址:${this.data6[index].address}`
})
},
remove (index) {
this.data6.splice(index, 1);
}
} }
} }
</script> </script>