A Vue directive for hoisting DOM elements to a higher parent node.
# npm
npm install --save vue-directive-hoist
# yarn
yarn add vue-directive-hoist
// In main.js
import Hoist from 'vue-directive-hoist';
Vue.use(Hoist);
<!-- In a component -->
<template>
<div class="modal" v-hoist>
<div class="modal-content">
<p>
A common use case for hoist is to place modals as a direct descendant of body,
so it can properly overlay the page.
</p>
</div>
</div>
</template>
If no value is provided, by default the element is hoisted to <body>
.