Closed wxwebfeng closed 1 week ago
有合适方案吗
同样的问题,有合适方案吗
借助 vite-plugin-vue-devtools 发现 n-form-item
注入
// UploadImage.vue
import type { FormItemInjection } from 'naive-ui/es/_mixins/use-form-item';
const formItem = inject<FormItemInjection>('n-form-item');
...
formItem?.handleContentChange(); // 上传成功后调用
Through custom upload, callback successfully verifies the form
This function solves the problem (这个功能解决的问题)
表单中有附件必填,上传了之后 form校验提示还是一直提示,需要开发者去手动触发校验才能清除,或者本有一个附件用户删除了,逻辑上是需要提示用户这是必填,期待后期能与formItem的 handleContentChange 方法触发自动校验
Expected API (期望的 API)
表单中有附件必填,上传了之后 form校验提示还是一直提示,需要开发者去手动触发校验才能清除,或者本有一个附件用户删除了,逻辑上是需要提示用户这是必填,期待后期能与formItem的 handleContentChange 方法触发自动校验