-
Notifications
You must be signed in to change notification settings - Fork 93
feat(dialogs/spawnDialog): separate spawning options from dialog props and allow Element as a container #6756
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
Conversation
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 breaking change as such I approve. But I would really favorite to move the onClose
callback to a promise based return.
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.
Looks valid.
But I don't get what's the reason for moving container out? it should be delegated to Vue on where to mount component instead of 'appendChild'?
Do you mean why we create a new element inside the container and not mount directly into the container? |
If yes - because it allows using container for many dialogs and have other elements there. For example, if you pass |
let { container } = optionsOrOnClose | ||
|
||
// For backwards compatibility try to use container from props | ||
if ('container' in props && typeof props.container === 'string') { |
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.
if ('container' in props && typeof props.container === 'string') { | |
if (!container && 'container' in props && typeof props.container === 'string') { |
Do not override if already in opts
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.
Did
if ('container' in props && typeof props.container === 'string') {
container ??= props.container
}
instead.
(Seems slightly more readable to me to not think about brackets in !container && 'container' in 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.
!container && 'container' in props
vs !container && ('container' in props)
Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Grigorii K. Shartsev <[email protected]>
d499f4d
to
c726508
Compare
/backport to stable8 |
☑️ Resolves
spawnDialog
or add a new function #6731🏁 Checklist
stable8
for maintained Vue 2 version or not applicable