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

🐛[BUG] columns定义的select valueType,通过request请求时,页面一直loading #8184

Closed
slcnx opened this issue Feb 23, 2024 · 3 comments

Comments

@slcnx
Copy link

slcnx commented Feb 23, 2024

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

  const columns:ProColumns<Task>[] = [
  {
    title: '仓库',
    dataIndex: 'repository',
    valueType: 'select',
    request: async () => {
      const {data } = await repo_list.runAsync({
      })

      return  data?.map(item => {
        return {
          label: item.name,
          value: item.name 
        }
      }) || [{}]
    }
  },
]

💻 复现代码

  "dependencies": {
    "@ant-design/icons": "^5.0.1",
    "@ant-design/pro-components": "^2.4.4",
    "@emotion/css": "^11.11.2",
    "@umijs/max": "^4.1.1",
    "ahooks": "^3.7.10",
    "antd": "^5.4.0"
  },
  "devDependencies": {
    "@types/react": "^18.0.33",
    "@types/react-dom": "^18.0.11",
    "@umijs/mfsu": "^4.1.2",
    "husky": "^8.0.3",
    "lint-staged": "^13.2.0",
    "prettier": "^2.8.7",
    "prettier-plugin-organize-imports": "^3.2.2",
    "prettier-plugin-packagejson": "^2.4.3",
    "typescript": "^5.0.3"
  }

image

@slcnx
Copy link
Author

slcnx commented Feb 23, 2024

@sorrycc

@slcnx
Copy link
Author

slcnx commented Feb 24, 2024

解决了, 我直接使用浏览器的。 await fetch('http://localhost:8000/api/repo/', {}).then((data) => data.json()) 这个是正常的

ahooks的此enum request加载得添加 manual=True,才可以。

@slcnx slcnx closed this as completed Feb 24, 2024
@slcnx
Copy link
Author

slcnx commented Feb 24, 2024

解决了!!

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

No branches or pull requests

1 participant