## 基础表格 ```html ``` ## 带斑马纹表格 ```html ``` ## 带边框表格 ```html ``` ## 带状态表格 ```html ``` ## 固定表头 ```html ``` ## 固定列 ```html ``` ## 固定列和表头 ```html ``` ## 单选

{{ singleSelection | json }}

```html ``` ## 多选

{{ multipleSelection | json }}

```html ``` ## 排序 ```html ``` ## el-table API | 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------- |-------------- |---------- |-------------------------------- |-------- | | data | 显示的数据 | array | | | | height | table 的高度,默认高度为空,即自动高度 | string | | '' | | stripe | 是否为斑马纹 table | boolean | | false | | border | 是否带有纵向边框 | boolean | | false | | selectionMode | 列表项选择模式 | string | 'single', 'multiple', 'none' | 'none' | | allowNoSelection | 单选模式是否允许选项为空 | boolean | | false | | selection | 多选模式下返回数组,单选模式下返回选中的元素。 | array/object | | | | fixedColumnCount | 固定列的个数 | number | | 0 | ## el-table 事件 | 事件名 | 说明 | 参数 | | ---- | ---- | ---- | | selection-change | 当选择项发生变化时会触发该事件 | selected | | cell-mouse-enter | 当单元格 hover 进入时会触发该事件 | row, column, cell, event | | cell-mouse-leave | 当单元格 hover 退出时会触发该事件 | row, column, cell, event | | cell-click | 当某个单元格被点击时会触发该事件 | row, column, cell, event | ## el-table-column API | 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------- |-------------- |---------- |-------------------------------- |-------- | | label | 显示的标题 | string | | '' | | property | 对应列内容的字段名 | string | | '' | | width | 对应列的宽度 | string | | | | sortable | 对应列是否可以排序 | boolean | | false | | type | 对应列的类型。如果设置了 `selection` 则显示多选按钮,如果设置了 `index` 则显示该行的索引(从 1 开始计算) | string | 'selection', 'index' | 0 | | formatter | 用来格式化内容,在 formatter 执行的时候,会传入 row 和 column | function | | |