Skip to content

when use appendchild in vueComponent,and via v-if to control component, get "Failed to execute 'insertBefore' on 'Node' " #10399

@garfieldon757

Description

@garfieldon757

Vue.js version
2.6.3

`Modal.vue

<script> export default { mounted () { document.getElementById('app').appendChild(this.$el) } } </script>

Something.vue

Some text here

Show modal
<script> import Modal from './ui/Modal' export default { data: function () { return { showModal: false } }, components: { Modal } } </script>`

What is Expected?
When click on the close button, it should close the modal window.

What is actually happening?
Console shows me the error DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions