-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
refactor(components): refactor menu #3639
Conversation
65ffdef
to
65bd98f
Compare
8341c64
to
26b7a13
Compare
I'm looking into this now |
setup() { | ||
const instance = getCurrentInstance()! | ||
const menu = inject<MenuProvider>('rootMenu') | ||
if (!menu) throwError(COMPONENT_NAME, 'can not inject root menu') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I know this file wasn't originated from you, but the error message here is confusing we might need to change it to:
needs be nested under
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always create a follow up issue for fixing.
}, | ||
} as BaseTransitionProps<HTMLElement> as TransitionProps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeremyWuuuuu I added type here.
click: (item: MenuItemRegistered) => | ||
isString(item.index) && Array.isArray(item.indexPath), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to implement the actual method here? Since I thought this should only be available for marking the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to validate the emit. Since I wrote it, just keep it, and it won't affect production.
const rootMenu = inject<MenuProvider>('rootMenu') | ||
if (!rootMenu) throwError(COMPONENT_NAME, 'can not inject root menu') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: Maybe we can make rootMenu
a symbol
as we did for elFormKey
, and extract them into @element-plus/tokens
This can be changed in a followup PR. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tried, but @element-plus/token
build script seems broken. So I need fix build script first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then how did the forms and buttons working 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only God knows. 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript emit errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for a best practice on Git we should not introduce irrelevant changes into this.
Most of my comments were not blocking but I think the changes against |
@JeremyWuuuuu Done. |
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.