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

fix(components): [dropdown] improve types #12514

Merged
merged 1 commit into from
Apr 20, 2023
Merged

fix(components): [dropdown] improve types #12514

merged 1 commit into from
Apr 20, 2023

Conversation

ModyQyW
Copy link
Contributor

@ModyQyW ModyQyW commented Apr 19, 2023

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

This PR improves dropdown types.

Previously, we have to write types to use dropdown ref to avoid any.

const dropdown1 = ref()
import { ElDropdown } from 'element-plus'
const dropdown1 = ref<InstanceType<typeof ElDropdown>>()

After this, we can directly import and use the type.

const dropdown1 = ref()
import type { DropdownInstance } from 'element-plus'
const dropdown1 = ref<DropdownInstance>()

Also, I updated the example file to use the new type.

@pull-request-triage
Copy link

👋 @ModyQyW, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Apr 19, 2023
@github-actions
Copy link

github-actions bot commented Apr 19, 2023

@github-actions
Copy link

Hello @ModyQyW, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@tolking tolking enabled auto-merge (squash) April 19, 2023 12:54
@tolking tolking disabled auto-merge April 19, 2023 12:54
@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Apr 19, 2023
@github-actions
Copy link

🧪 Playground Preview: https://element-plus.run/?pr=12514
Please comment the example via this playground if needed.

@btea btea merged commit 0f4aeaf into element-plus:dev Apr 20, 2023
9 checks passed
@btea
Copy link
Collaborator

btea commented Apr 20, 2023

@ModyQyW Thank you for your contribution ❤️

@element-bot element-bot mentioned this pull request Apr 23, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants