Skip to content
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

Form ApiSelect 类型, 当参数 mode 为 multiple 时, 类型报错 #468

Closed
carl-jin opened this issue Apr 10, 2021 · 0 comments
Closed

Comments

@carl-jin
Copy link

我是这样配置的

export default [
  {
    label: '管理员',
    field: 'user_ids',
    component: 'ApiSelect',
    colProps: { span: 24 },
    componentProps: {
      api: getUsersSelectList,
      mode: 'multiple',
    },
  },
] as FormSchema[];

执行后, 报错
如同下图所示
image

需要在此处多加个类型判断
https://github.com/anncwb/vue-vben-admin/blob/ee1c3498587951a6a4cc0b49edb9dacf3f2af5c3/src/components/Form/src/components/ApiSelect.vue#L44

      value: propTypes.string | propTypes.array,
@anncwb anncwb closed this as completed in 37c5741 Apr 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
ethan-wilson-1291 pushed a commit to ethan-wilson-1291/vue-vben-admin that referenced this issue Feb 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant