0.0.7 • Published 2 years ago

z-custom-table v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

表格实例- 参考配置

<template>
 <div>
   <z-customtable  v-bind="tableSetAttr">
     <template v-for="item in tableSetAttr.tableAttr.columns">
       <el-table-column
         :fixed="item.fixed"
         :prop="item.dataKey"
         :sortable="item.sortable"
         :label="item.title"
         :width="item.width"
       />
     </template>
   </z-customtable>
 </div>
</template>


<style lang="scss"></style>

表格实例- 启动虚拟表格/滚动条跟随

<template>
 <div>

   <z-customtable ref="dom" class="custom" :tableData="data" :requestLoading="requestLoading" v-bind="tableSetAttr">
     <template v-for="item in tableSetAttr.tableAttr.columns">
       <el-table-column
         v-if="!['action'].includes(item.dataKey)"
         :fixed="item.fixed"
         :prop="item.dataKey"
         :sortable="item.sortable"
         :label="item.title"
         :width="item.width"
       ></el-table-column>
     </template>
     <!-- <el-table-column prop="name" label="Name" width="120" />
     <el-table-column prop="state" label="State" width="120" />
     <el-table-column prop="city" label="City" width="120" />
     <el-table-column prop="address" label="Address" width="600" />
     <el-table-column prop="zip" label="Zip" width="120" />
     <el-table-column fixed="right" label="action" width="120">
       <template #default >
         <el-button link type="primary" size="small" >Detail</el-button>
         <el-button link type="primary" size="small">Edit</el-button>
       </template>
     </el-table-column> -->
     <el-table-column prop="action" label="action" width="120">
       <template #default>
         <el-button link type="primary" size="small">Detail</el-button>
         <el-button link type="primary" size="small">Edit</el-button>
       </template>
     </el-table-column>
   </z-customtable>
 </div>
</template>


<style lang="scss">
.custom {
}
</style>

表格属性

属性描述备注
tableData表格数据Array
requestLoading加载boolean
onRequest操作请求 promise(paginationOption) => Promise
showPage显示分页boolean
virtualized开启虚拟化表格boolean
stickyed横向滚动条随屏boolean
tableEvent表格事件同element-plus
tableAttr表格配置同element-plus , virtualized: true时宽度受tableAttr.width限制 参考实例
paginationOption分页配置同element-plus
paginationEvent分页事件配置同element-plus

ref defineExpose 方法

方法描述备注
emitPageDefault设置 paginationOptionArray

ref defineExpose 属性

方法描述备注
paginationOptionConfig设置 paginationOptionArray
tableEventConfig表格事件Array
0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago