long-one-table
v1.1.0
Published
table二次封装
Downloads
2
Readme
包名
long-one-table
内置组件 (Table,Spage)
组件名(Table)
参数
const tableData = {
data:[
{
date: '2016-05-03',
name: 'Tom',
address: '天河',
age:23
},
{
date: '2016-05-02',
name: 'Jick',
address: '嫦娥',
age:24
},
{
date: '2016-05-04',
name: 'Mary',
address: '玉兔',
age:22
},
{
date: '2016-05-01',
name: 'Bob',
address: '广寒',
age:66
},
],
style:{
textAlign:'center',
border:true,
width:500+'px'
}
}
const config = [
{
type:'callback',
prop:'date',
label:'日期',
callback:(n)=>new Date(n).getTime()/1000+'+'+'中国'
},
{
type:'btn',
prop:'name',
label:'名字',
style:{
size:'small',
type:'primary'
}
},
{
type:'text',
prop:'address',
label:'地址'
},
{
type:'slot',
prop:'age',
label:'年龄',
name:'nian'
}
];
<Table :tableData="tableData" :colmunConfig="colmunConfig">
<template #nian="{msg}">
<h1>{{ msg }}</h1>
</template>
</Table>
组件(Spage)
const PageData = {
currentPage1:5,
currentPage2:5,
currentPage3:5,
currentPage4:4,
pageSize2:100,
pageSize3:100,
pageSize4:100,
small:false,
background:false,
disabled:false,
handleSizeChange:(val) => {
console.log(`${val} items per page`);
},
handleCurrentChange:(val) => {
console.log(`current page: ${val}`)
}
};
<spage :PageData="PageData"></spage>