# table-vue3 **Repository Path**: childe-jia/table-vue3 ## Basic Information - **Project Name**: table-vue3 - **Description**: vue 3 element-plus table 的封装 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 0 - **Created**: 2023-10-17 - **Last Updated**: 2024-10-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 技术交流群 711368818 ## Introduction ### WHAT i-table 基于元素 element-plus,但不限于元素 element-plus 组件。在完全继承 element-plus 元素的 table 属性的基础上,进行了扩展。一些非表格组件或自定义组件,因此,用户可以使用一段 json 来呈现完整的表格。 ### WHY 在我们的日常开发中,有很多有表格的页面,通常表格结构相似,逻辑重复。i-table 没有复杂的逻辑。它只转换 JSON 来呈现表格项,节省了编写业务逻辑的时间和精力,并减少了重复代码。 ## Features - 用 json 呈现表格 - 支持数据列配置及插槽 - 支持操作列配置及插槽 - 支持多选框配置 - 支持分页显示 - 支持响应式表格 ## Links - [vue2&&vue3--render 函数(h)](https://blog.csdn.net/qq_63358859/article/details/134004642?spm=1001.2014.3001.5501) - [vue2 与 vue3 生命周期的区别](https://blog.csdn.net/qq_63358859/article/details/134015846?spm=1001.2014.3001.5502) - [vue2 与 vue3 v-model 的区别](https://blog.csdn.net/qq_63358859/article/details/133484380?spm=1001.2014.3001.5501) - [vue2 版本](https://blog.csdn.net/qq_63358859/article/details/132714435?spm=1001.2014.3001.5502) - [element-plus 表单的封装](https://gitee.com/childe-jia/form-render.git) ## Quick Start ```ts git clone https://gitee.com/childe-jia/table-vue3.git 拉下项把 src\components\i-table 下组件放入自己项目 可跟业务场景自行修改 ``` ```ts ``` ## Props ```ts export default { // ... props: { noStatic: false, // 是否计算表格高度 options: { type: Object, default: { stripe: false, // 是否为斑马纹 table loading: false, // 是否添加表格loading加载动画 highlightCurrentRow: false, // 是否支持当前行高亮显示 mutiSelect: false, // 是否支持列表项选中功能 border: false, //是否显示边框 selectable: () => { //是否可以选中 return false; }, }, }, // table 表格的控制参数 total: { type: Number, default: 0, }, // 总数 list: { type: Array, default: [], // prop:表头绑定的地段,label:表头名称,align:每列数据展示形式(left, center, right),width:列宽 }, // 数据列表 customHeight: { //与noStatic一起使用 type: Number, default: 320, }, columns: { type: Array, default: [], // 需要展示的列 === prop:列数据对应的属性,label:列名,align:对齐方式,width:列宽 }, operates: { type: Object, defaultt: () => {}, // width:按钮列宽,fixed:是否固定(left,right),按钮集合 === label: 文本,type :类型(primary / success / warning / danger / info / text),show:是否显示,icon:按钮图标,plain:是否朴素按钮,disabled:是否禁用,method:回调方法 }, otherHeight: { type: Number, default: 180, }, // 计算表格的高度 pagination: { type: Object, default: null, // 分页参数 === pageSize:每页展示的条数,pageIndex:当前页,pageArray: 每页展示条数的控制集合,默认 _page_array }, }, }; ``` ## Methods support all [el-table's methods](https://element-plus.org/zh-CN/#/zh-CN) ## Inspiration thanks to [Vue2.5 结合 Element UI 之 Table 和 Pagination 组件实现分页](https://juejin.cn/post/6844903555598401544)