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

feat: mounting-portal component support mount to customized HTMLElement #278

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Ryqsky
Copy link

@Ryqsky Ryqsky commented Dec 3, 2019

when the HTMLElement comes form other iframe so that window.document.querySelector is different and inoperative

…nt (when the HTMLElement comes form other iframe so that window.document is different)
@cihad
Copy link

cihad commented Feb 29, 2020

@Ryqsky Is this can be an usage example:

<div id="app">
  <MountingPortal :mountTo="mountTo" name="source" append>
    <p>Content for the Target</p>
  </MountingPortal>
<div>

<aside id="widget" class="widget-sidebar">
  This Element is not controlled by our Vue-App,
  but we can create a <portal-target> here with <MountingPortal>.
</aside>

<script>
  new Vue({
    el: '#app',
    data() {
      return { mountTo: window['widget'] }
    },
  })
</script>

@Ryqsky
Copy link
Author

Ryqsky commented Mar 2, 2020

@Ryqsky Is this can be an usage example:

<div id="app">
  <MountingPortal :mountTo="mountTo" name="source" append>
    <p>Content for the Target</p>
  </MountingPortal>
<div>

<aside id="widget" class="widget-sidebar">
  This Element is not controlled by our Vue-App,
  but we can create a <portal-target> here with <MountingPortal>.
</aside>

<script>
  new Vue({
    el: '#app',
    data() {
      return { mountTo: window['widget'] }
    },
  })
</script>

@cihad
Can you provide an online address in https://codesandbox.io/ ?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants