【新增】j-table
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<j-table :isShowPage="isShowPage" :isCheck="isCheck" :dataSource="dataSource" :columns="columns"></j-table>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JTable from '@/components/table/jTable'
|
||||
|
||||
export default {
|
||||
name: 'Jtable',
|
||||
components: {
|
||||
JTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowPage: true, // 是否显示分页
|
||||
isCheck: false, // 是否多选
|
||||
dataSource: [{
|
||||
key: '1',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '2',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '3',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '4',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '5',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '6',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号',
|
||||
address1: '西湖区湖底公园1号',
|
||||
address2: '西湖区湖底公园1号',
|
||||
address3: '西湖区湖底公园1号',
|
||||
address4: '西湖区湖底公园1号',
|
||||
address5: '西湖区湖底公园1号',
|
||||
}],
|
||||
columns: [{
|
||||
// title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '姓名'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '年龄',
|
||||
dataIndex: 'age',
|
||||
key: 'age',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '年龄'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '住址'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址1',
|
||||
dataIndex: 'address1',
|
||||
key: 'address1',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '住址1'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址2',
|
||||
dataIndex: 'address2',
|
||||
key: 'address2',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '住址2'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址3',
|
||||
dataIndex: 'address3',
|
||||
key: 'address3',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '住址3'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址4',
|
||||
dataIndex: 'address4',
|
||||
key: 'address4',
|
||||
width: 200,
|
||||
slots: {
|
||||
title: '住址4'
|
||||
}
|
||||
},
|
||||
{
|
||||
// title: '住址5',
|
||||
dataIndex: 'address5',
|
||||
key: 'address5',
|
||||
slots: {
|
||||
title: '住址5'
|
||||
}
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
pageSizeOptions: ['5', '10', '20'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + "-" + range[1] + " 共" + total + "条"
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user