-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
feat(runtime-dom): support mount app on ShadowRoot #2447
Conversation
packages/runtime-dom/src/index.ts
Outdated
if (isString(container)) { | ||
const res = document.querySelector(container) | ||
if (__DEV__ && !res) { | ||
warn(`Failed to mount app: mount target selector returned null.`) | ||
} | ||
return res | ||
} | ||
if (container instanceof ShadowRoot) { |
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.
mode: 'closed'
doesn't actually prevent Vue from mounting to it (see https://blog.revillweb.com/open-vs-closed-shadow-dom-9f3d7427d1af) so this whole check is unnecessary
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.
no in-depth study yet, but at least input can't work
https://codepen.io/unbyte/pen/XWKjaVO?editors=1010
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.
Isn't it working? https://codepen.io/yyx990803/pen/KKMgooN?editors=1010
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 know why now. It's a regression of Vimium, an extension that I enabled in my browsers. philc/vimium#853
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.
So I wonder if warnings should be retained so that developers can be aware that some of the problems may be caused by the closed shadow root, for what the user side is using is beyond developers' control
close #2399