feat: grid add delete api

pull/2/head
xingyu 2022-11-29 21:02:42 +08:00
parent 6b2d1b50ee
commit 7e41b763f6
1 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,15 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => {
resolve(await config?.getListApi(queryParams)) resolve(await config?.getListApi(queryParams))
}) })
}, },
delete: ({ body }) => {
return new Promise(async (resolve) => {
if (config?.deleteApi) {
resolve(await config?.deleteApi(JSON.stringify(body)))
} else {
Promise.reject('未设置deleteApi')
}
})
},
queryAll: ({ form }) => { queryAll: ({ form }) => {
const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form)))
return new Promise(async (resolve) => { return new Promise(async (resolve) => {