表格组件示例

Former-commit-id: dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly 096c7586394466fcfa6aeef76f941c65b6c58cb3 [formerly 6ea50546558bb7a5f54d99d34301d3fbae8beea4]]]]]
Former-commit-id: 4909868f8dac1be92c76feda0bc3c4a51f8221ca
Former-commit-id: 7bcf816a13380e5e1823ef3d8a0050fa95842c73
Former-commit-id: cea58af19fb83f6e4f61a7cc95e999706784a7f2 [formerly 881c7fe80386e4bbd6bdd323eb873c98e7894941]
Former-commit-id: edf39aef375f7ecf4d07951f57b8a92baab4ee37
Former-commit-id: 829a819ac72421f791a5cf5a4d62b7a860e7648b
Former-commit-id: e3da2e3e4a6f41a5a712760729560efdcf551a3f
Former-commit-id: 57e8f1b908c2578a985798a6672a650b9dc53c0c
Former-commit-id: 9667afc9b61cdbc5c624a07ee92b4156d0470582
This commit is contained in:
liyang
2018-07-22 18:35:37 +08:00
parent 04de4950fc
commit 4bb3422148
23 changed files with 1509 additions and 44 deletions

View File

@@ -0,0 +1,73 @@
<template>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
label="日期"
width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.date }}</span>
</template>
</el-table-column>
<el-table-column
label="姓名"
width="180">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p>姓名: {{ scope.row.name }}</p>
<p>住址: {{ scope.row.address }}</p>
<div slot="reference" class="name-wrapper">
<el-tag size="medium">{{ scope.row.name }}</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
title: '自定义列模板',
data () {
return {
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}]
}
},
methods: {
handleEdit (index, row) {
console.log(index, row)
},
handleDelete (index, row) {
console.log(index, row)
}
}
}
</script>