vbenjs / vue-vben-admin

A modern vue admin panel built with Vue3, Shadcn UI, Vite, TypeScript, and Monorepo. It's fast!
https://www.vben.pro
MIT License
24.96k stars 6.79k forks source link

FEATURE: `useVbenVxeGrid`提供操作表单的api #4581

Closed imdap closed 2 weeks ago

imdap commented 2 weeks ago

Version

Vben Admin V5

Description

在覆盖默认重置逻辑时,表单不会被清理,需要提供操作form的api来手动清理

handleSubmit: async () => {
    const formValues = formApi.form.values;
    props.api.reload(formValues);
  },
  // 覆盖默认的reset逻辑会导致表单value不会被正常清理  还是原始值   且没有api来手动清理
  handleReset: async () => {
    await formApi.resetForm();
    const formValues = formApi.form.values;
    props.api.reload(formValues);
  },

其他的需要更新Select options场景也需要用到form api

Proposed Solution

useVbenVxeGrid提供操作表单的api

Alternatives Considered

No response

Additional Context

No response

Validations

anncwb commented 2 weeks ago

gridApi内部提供了formApi实例