Package Exports
- vue-dynamic-mounting
- vue-dynamic-mounting/dist/index.es.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-dynamic-mounting) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Vue Dynamic Mounting
Programmatically mount your component anywhere
Installation
pnpm add vue-dynamic-mounting
# or
npm i vue-dynamic-mounting
# or
yarn add vue-dynamic-mountingUsage
In your <script> block
import { useMounting } from 'vue-dynamic-mounting'
const { mount, componentMounted } = useMounting()
function openDialog() {
const { unmount } = mount(Dialog, { content: 'HelloWorld', onClose: unmount }, '#dialog-teleport')
}<template> block:
<section>
<button @click="openDialog">
Open Dialog
</button>
<div id="dialog-teleport"></div>
</section>