Skip to content

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.

2 participants