0.2.1 • Published 1 year ago

ye_element_table v0.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

ye_element_table(封装 element ui 中表格组件)

1. 安装

	npm install ye_element_table

2. 引入组件

2.1 在 main.js 中引用

	import yeElementTable from 'yeElementTable'
	Vue.use(yeElementTable)

3. 使用

3.1 html 中使用标签

<yeElementTable :tableOption="tableOption" @get-table-data="getTableData">
  <template v-slot:menu="scope">
    <el-button @click="handleClick(scope.row)">操作列插槽</el-button>
  </template>
  <template v-slot:sexSlot="scope">
    <el-tag>{{scope.row.表格列插槽}}</el-tag>
  </template>
</yeElementTable>

3.2 表格参数 tableOption

参数说明类型可选值默认值
name表格名称Stringye-table
tableColumnList表格列List详见 tableColumnList 参数[]
api表格接口 apiapi
searchParams调接口,传的参数Object{}
operaColumnParams用于设置是否显示操作列和显示操作列的宽度Object{isShow: true,width: 100px}{isShow: false,width: 100px}

3.2.1 tableColumnList 参数

tableColumnList为数组,数组的一项,每一项为一个对象,代表设置表格一列的参数,对象参数如下
参数说明类型是否必填备注
prop列名String
label列中文名String
width列宽度String/Number
isSlot该列是否为插槽boolean若为 true,需要在标签中添加插槽,例子详见:操作列插槽
formatter自定义列functionformatter: (row)=>{return row.class}},
0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago