Skip to content

vue-mount-pluginVue Component Mounting Made Simple

A simple and easy to use Vue instance extension plugin that supports Vue 2.0 and Vue 3.0

vue-mount-plugin

Quick Start

Install

bash
# pnpm
pnpm add vue-mount-plugin

# npm
npm install vue-mount-plugin

# yarn
yarn add vue-mount-plugin

Usage

typescript
import { mount } from 'vue-mount-plugin'
import Modal from './Modal.vue'

// Mount and show immediately
const instance = mount(Modal, {
  props: { title: 'Hello World' }
})

// Unmount when done
instance.unmount()

Why vue-mount-plugin?

  • No Boilerplate: No need to manually manage DOM elements and Vue instances
  • Flexible Control: Fine-grained control over component lifecycle
  • Context Inheritance: Proper context inheritance for Vue 3 (router, pinia, i18n)
  • Auto Cleanup: Automatic cleanup with useMount composable
  • Lightweight: Small bundle size with tree-shaking support

Released under the MIT License.