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

RadioButtonGroup 是否有后台获取字典数据 API 的实现 #1263

Closed
ldw4033 opened this issue Oct 5, 2021 · 3 comments
Closed

RadioButtonGroup 是否有后台获取字典数据 API 的实现 #1263

ldw4033 opened this issue Oct 5, 2021 · 3 comments

Comments

@ldw4033
Copy link

ldw4033 commented Oct 5, 2021

刚接触vben 不长时间,项目非常适合我,很优秀的脚手架。
现在遇到一个问题,RadioButtonGroup 是否有后台获取字典数据 API 的实现,像 ApiSelect 组件那样,现在好多项目状态值是后台API 接口提供的。
目前我查找到的RadioButtonGroup 用法:

{
    field: 'status',
    label: '状态',
    required: false,
    component: 'RadioButtonGroup',
    defaultValue: 0,
    componentProps: {
      options: [
        { label: '禁用', value: 0 },
        { label: '启用', value: 1 },
      ],
    },
  },
  {
    field: 'gender',
    label: '性别',
    required: false,
    component: 'RadioButtonGroup',
    defaultValue: 0,
    componentProps: {
      options: [
        { label: '未知', value: 0 },
        { label: '男', value: 1 },
        { label: '女', value: 2 },
      ],
    },
  },

想了解下,componentProps 中的 option 能否由后台接口提供,并提供一下demo。谢谢

@ghost
Copy link

ghost commented Oct 6, 2021

这个和API后端是不耦合的, 需要自己去拉取组件数据, 然后定义ref, 直接在schema种引用ref.value作为options就好了

@ldw4033
Copy link
Author

ldw4033 commented Oct 19, 2021

@thinkershare tks

@anncwb
Copy link
Collaborator

anncwb commented May 6, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@anncwb anncwb added the Stale label May 6, 2024
@anncwb anncwb closed this as completed May 13, 2024
@vbenjs vbenjs locked and limited conversation to collaborators Aug 3, 2024
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

2 participants