vue-element-plus-admin
vue-element-plus-admin copied to clipboard
表格组件如何支持查询呢,使用fetchDataApi,如何传入查询参数,怎样动态更新
const { tableMethods, tableState } = useTable({
fetchDataApi: async () => {
const { currentPage, pageSize } = tableState
const res = await getGasWeekList({
pageIndex: unref(currentPage),
pageSize: unref(pageSize),
siteNo: getSiteNo()
})
const list: Array[${dayjs(element.weekStart).format('YYYY.MM.DD')}]--[${dayjs(element.weekEnd).format('YYYY.MM.DD')}]
list.push({
weekDate,
siteName: siteNameMap[element.siteNo], ...element
})
})
return {
list: list,
total: res.total
}
}
})