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

修改ApiSelect的isFirstLoaded赋值逻辑,只有当加载报错时才需要恢复未初次加载状态 #3671

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

SunsetSail
Copy link

General

✏️ Mark the necessary items without changing the structure of the PR template.

  • Pull request template structure not broken

Type

ℹ️ What types of changes does your code introduce?

👉 Put an x in the boxes that apply

  • [x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

👉 Put an x in the boxes that apply.

  • [ x] My code follows the style guidelines of this project
  • [ x] Is the code format correct
  • [ x] Is the git submission information standard?
  • [x ] My code follows the style guidelines of this project
  • [x ] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas
  • [x ] I have made corresponding changes to the documentation
  • [x ] My changes generate no new warnings
  • [x ] I have added tests that prove my fix is effective or that my feature works
  • [x ] New and existing unit tests pass locally with my changes
  • [ x] Any dependent changes have been merged and published in downstream modules

当指定了immediate:false时,每次点击组件都会触发一次加载方法,这里只需要在加载失败时才需要重新加载。否则不需要重新调用接口。
测试代码

      {
        field: 'SupplierID',
        component: 'ApiSelect',
        label: '供应商',
        required: true,
        componentProps: {
          immediate: false,
          placeholder: '请输入',
          api: SupplierOptionsListApi,
          resultField: 'list',
        },
      },

@wangjue666
Copy link
Collaborator

nice catch!

@wangjue666 wangjue666 merged commit 3d733de into vbenjs:main Mar 14, 2024
2 checks passed
@vbenjs vbenjs locked and limited conversation to collaborators Aug 4, 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

Successfully merging this pull request may close these issues.

2 participants