8000 Select控件下拉框大小配置不生效 · Issue #11991 · baidu/amis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Select控件下拉框大小配置不生效 #11991

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
wwsheng009 opened this issue May 19, 2025 · 0 comments
Open

Select控件下拉框大小配置不生效 #11991

wwsheng009 opened this issue May 19, 2025 · 0 comments

Comments

@wwsheng009
Copy link

描述问题:

在使用select控件时,如果使用source api提供选项列表,overlay配置选项不生效。

截图或视频:

可以在以下地址找到可重复问题的代码与示例。
http://fun.wwsheng.xyz:5099/amis-editor/#/select

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdk

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在

6.11.0,6.12都存在问题。

  1. 粘贴有问题的完整 amis schema 代码:

正确没有问题的代码,下拉框大小可以控制。

{
  "type": "page",
  "title": "select",
  "body": [
    {
      "type": "select",
      "id": "u:fc6740e2cc60",
      "name": "model",
      "overlay": {
        "width": "70%",
        "align": "center"
      },
      "searchable": true,
      "columns": [
        {
          "name": "label",
          "label": "描述"
        },
        {
          "name": "value",
          "label": "模型"
        }
      ],
      "selectMode": "table",
      "placeholder": "请选择模型",
      "labelClassName": "hidden",
      "multiple": false,
      "onEvent": {
        "change": {
          "actions": [
            {
              "actionType": "reload",
              "args": {
                "model": "${value}"
              },
              "componentName": "api_list"
            }
          ]
        }
      },
      "options": [
        {
          "label": "诸葛亮",
          "value": "zhugeliang",
          "position": "中单"
        },
        {
          "label": "曹操",
          "value": "caocao",
          "position": "上单"
        },
        {
          "label": "钟无艳",
          "value": "zhongwuyan",
          "position": "上单"
        },
        {
          "label": "李白",
          "value": "libai",
          "position": "打野"
        },
        {
          "label": "韩信",
          "value": "hanxin",
          "position": "打野"
        },
        {
          "label": "云中君",
          "value": "yunzhongjun",
          "position": "打野"
        }
      ]
    }
  ],
  "id": "u:e0af693c5d73",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  }
}

错误的代码,以上是配置source作为动态数据源,在点击下拉框后,下拉列表会自动的撑开到100%宽度,overlay的配置不生效

{
  "type": "page",
  "title": "select",
  "body": [
    {
      "type": "select",
      "id": "u:fc6740e2cc60",
      "name": "model",
      "overlay": {
        "width": "70%",
        "align": "center"
      },
      "searchable": true,
      "columns": [
        {
          "name": "label",
          "label": "描述"
        },
        {
          "name": "value",
          "label": "模型"
        }
      ],
      "selectMode": "table",
      "placeholder": "请选择模型",
      "labelClassName": "hidden",
      "multiple": false,
      "onEvent": {
        "change": {
          "actions": [
            {
              "actionType": "reload",
              "args": {
                "model": "${value}"
              },
              "componentName": "api_list"
            }
          ]
        }
      },
      "source": {
        "url": "/api/v1/system/meta/model/model_name_list",
        "method": "get"
      }
    }
  ],
  "id": "u:e0af693c5d73",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  }
}
  1. 操作步骤
    请简单描述一下复现的操作步骤...
    访问:http://fun.wwsheng.xyz:5099/amis-editor/#/select,输入验证码,再选择select示例代码
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

1 participant
0