Closed
Description
What problem does this feature solve?
Somethings I need to created detached components.
For example I may call this.$Message.info(content)
in which content may be a render function and the component created will be mounted on document.body
.
For example:
Before calling $Message.info
<body>
<div id="app />
</body>
After calling $Message.info
<body>
<div id="app">
<div class="message" />
</body>
Calling createApp(MessageComponent).mount(document.body)
inside $Message.info
may render the component in body. However the render function will use the new appContext rather than the original appContext which has already been registered with custom components. For example:
this.$Message.info(() => h('component-registered-on-app', ...))
What does the proposed API look like?
const app = createApp(rootComponent)
app.mount(document.body)
const childApp = app.createChildApp(detachedComponentWhichNeedSameContext)
childApp.mount(document.body)
Metadata
Metadata
Assignees
Labels
No labels