optimize Table style
optimize Table style
This commit is contained in:
parent
f9d87766ca
commit
e8ee1423e7
2 changed files with 8 additions and 30 deletions
|
@ -1,7 +1,7 @@
|
|||
// sortable
|
||||
.sortable() {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
width: 9px;
|
||||
height: 12px;
|
||||
margin-left: 4px;
|
||||
margin-top: -1px;
|
||||
|
|
|
@ -1,38 +1,27 @@
|
|||
<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>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
self: this,
|
||||
columns7: [
|
||||
columns1: [
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'name',
|
||||
render (row, column, index) {
|
||||
return `<Icon type="person"></Icon> <strong>${row.name}</strong>`;
|
||||
}
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
key: 'age'
|
||||
key: 'age',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
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: '王小明',
|
||||
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>
|
||||
|
|
Loading…
Add table
Reference in a new issue