-
Notifications
You must be signed in to change notification settings - Fork 440
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
chore(Vue3): v-bind checking #12005
chore(Vue3): v-bind checking #12005
Conversation
1295e86
to
2d3838e
Compare
<NcModal v-bind="$attrs" | ||
:container="container" | ||
<NcModal :container="container" |
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.
BreakoutRoomsEditor has v-bind="$attrs" on its root element, not needed as it is inherited automatically -> removed
This is not completely correct.
In Vue 3 - yes. Attribute inheritance works for both, HTML attributes and component props.
However, in Vue 2 it doesn't. It inherit attributes only as attributes to put them into $attrs
or the HTML element itself. But not as component props.
So, if we remove v-bind
here, no BreakoutRoomsEditor
attributes will be passed NcModal
's props.
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.
Still, it is fine to be removed.
Not because "it is inherited automatically" but because this BreakoutRoomsEditor
component actually doesn't need this inheritance at all. Currently it is never used with NcModal
props.
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.
Right, I also checked and saw no props are needed from the component $attrs
but forgot to mention it 😄
…ribute selection in vue 2 (individual attributes are always selected over those in v-bind). In vue 3, it depends on the order. Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
2d3838e
to
3d67844
Compare
rebased onto main |
☑️ Resolves
BreakoutRoomsEditor
hasv-bind="$attrs"
on its root element, not needed as it is inherited automatically (in Vue 3) but also no props are needed from$attrs
-> removed$attrs
has been used. If there are classes or styles that might be forwarded ( in Vue 3, classes and styles are also included) -> none🖌️ UI Checklist
🖼️ Screenshots / Screencasts
🚧 Tasks
🏁 Checklist