顯示表格組件。
## 屬性
| 參數 | 說明 | 類型 | 可選值 | 默認值
| --- | --- | --- | --- | ---
| api | 數據請求api,如果沒有設置其他場景的api,將使用這個api | string | |
| api-method | 指定所有請求使用的方法 | string | get,post,put,delete | post
| pager-api | 分頁請求api | string | |
| sorter-api | 排序請求api | string | |
| search-api | 查詢請求api | string | |
| table-data | 當前顯示的數據,支持sync修飾符 | array | |
| init-json | 初始化json內容,該內容與api返回內容相同,主要用于后端模板渲染方式,該參數支持指定pagesize,currentpage初始化:{data:[],pagesize:10,currentpage:2}。但是要注意init-json屬性會覆蓋設置的標簽prop。 | string | |
| total | 給分頁內容設置總信息數,一般只用于初始化的時候使用,支持sync修飾符 | number | |
| pager-page-size | 初始化指定每頁信息數量 | number | | 10
| pager-current-page | 指定當前頁碼,支持sync修飾符 | number | | 1
| with-pager | 是否啟用分頁 | Boolean | | true
| pager-layout | 分頁部分啟用的內容 | string | total, sizes, prev, pager, next, jumper | total, sizes, prev, pager, next, jumper
| pager-ref | 使用自定義的pager組件 | object | |
| selection | 通過表格的多選框選中的keys數組,支持sync修飾符 | string | |
| select-prop | 指定表格多選框選中后值的屬性名稱 | string | 表格data里的行屬性 | id
| search-form-filter | 當頁面有多個searchForm時,用于指定關聯的searchForm | string | |
| toolbar-filter | 當前工具欄的區分標識,當頁面有其他元素與工具欄關聯且擁有多個工具欄時使用 | string | |
| 其他 | 支持所有el-table的屬性
## 方法
| 參數 | 說明 | 參數
| --- | --- | ---
| refresh | 如果需要手動刷新表格,可通過調用實例的refresh()方法 | 無
## 事件
| 事件 | 說明 | 參數
| --- | --- | ---
| pager-current-change | 當前頁碼變化事件 | currentpage:修改后的頁碼
| pager-size-change | 每頁顯示信息數量變化 | pagesize:修改后的每頁信息數量
| sort-change | 數據排序變化時 | 排序內容對象:{column,prop,oder}
| selection-change | 復選框變化時的事件 | 當前選擇的值
| searched | 頁面關聯的searchForm查詢后事件 | searchData:搜索數據;searchFormFilter:關聯標識;data:搜索后表格數據。
| api-success | 表格進行api請求返回結果成功 | response:返回內容
| api-fail | 表格進行api請求返回結果失敗 | response:返回內容
| toolbar-deleted | 關聯toolbar的刪除按鈕執行事件 | deleteParam:刪除參數;toolbarFilter:關聯標識;response:返回內容
| toolbar-enable | 關聯toolbar的“設置為可用”按鈕執行后事件 | isSuccess:是否成功,指示請求返回的結果是否成功;toolbarFilter:關聯標識;response:返回內容。
| toolbar-disable | 關聯toolbar的“設置為不可用”按鈕執行后事件 | isSuccess:是否成功,指示請求返回的結果是否成功;toolbarFilter:關聯標識;response:返回內容。
| 其他 | 支持所有el-table的事件
## 插槽
| 插槽名 | 說明
| --- | ---
| append | 插入至表格最后一行之后的內容,如果需要對表格的內容進行無限滾動操作,可能需要用到這個 slot。若表格有合計行,該 slot 會位于合計行之上。
| empty | 空數據時顯示的文本內容,也可以通過屬性`empty-text`設置。
- 序言
- 安裝
- 組件查詢
- buttons
- WdApiButton
- WdDrawerButton
- WdRefreshButton
- WdRouteButton
- WdConfirmButton
- datagrid
- WdDatagrid
- WdGridDeleteButton
- WdGridEnableButton
- editgrid
- WdEditgrid
- WdEditgridCell
- element
- WdCard
- WdCollapse
- WdDrawerIframe
- WdIframe
- WdLabel
- WdSplitLabel
- WdDetail
- WdToolBar
- WdRepeater
- WdApiManager
- form
- WdDataForm
- WdSelect
- WdRadioList
- WdCheckboxList
- WdUploadImage
- search
- WdSearchCheckbox
- WdSearchDatepick
- WdSearchForm
- WdSearchInput
- WdSearchRadio
- WdSearchSelect
- tree
- WdTree
- 內置服務
- ajax服務
- 消息服務
- 框架方法
- tab操作
- 其他
- demo說明