Skip to content

Bug: Vben Modal 加载 Vben Form 之 ApiTreeSelect 报警告信息 #6318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks done
elkon028 opened this issue May 31, 2025 · 4 comments
Open
5 tasks done

Bug: Vben Modal 加载 Vben Form 之 ApiTreeSelect 报警告信息 #6318

elkon028 opened this issue May 31, 2025 · 4 comments

Comments

@elkon028
Copy link

elkon028 commented May 31, 2025

Version

Vben Admin V5

Describe the bug?

vben Modal 内的表单

 /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
  return [
    {
      fieldName: 'deptId',
      label: '归属部门',
      component: 'ApiTreeSelect',
      componentProps: {
        api: async () => {
          const data = await SystemDeptApi.getDeptList()
          return arrayToTree(data)
        },
        labelField: 'name',
        valueField: 'id',
        childrenField: 'children',
        placeholder: '请选择归属部门',
        defaultExpandAll: true,
      },
    },
  ]
}
[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead. 
  at <ElSelect name="deptId" id="v-24-form-item" modelValue=undefined  ... > 
  at <ElTreeSelect modelValue=undefined data= []length: 0[[Prototype]]: Array(0) onUpdate:modelValue=fn<onUpdate:modelValue>  ... > 
Image

报警告是在

  • packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
 this.store.setState((prev) => ({ ...prev, ...stateOrFn }));

Reproduction

null

System Info

all

Relevant log output

Validations

@mynetfan
Copy link
Collaborator

mynetfan commented Jun 1, 2025

Demo中未能重现/examples/form/basic

Copy link

github-actions bot commented Jun 1, 2025

Hello @elkon028. Please provide the complete reproduction steps and code. Issues labeled by needs reproduction will be closed if no activities in 3 days.

@elkon028
Copy link
Author

elkon028 commented Jun 2, 2025

Demo中未能重现/examples/form/basic

demo 并不是在 vben modal 组件内的表单

@JZaaa
Copy link

JZaaa commented Jun 6, 2025

我有同样的问题警告,也是ApiTreeSelect 用的是element-plus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants