Skip to content

API Reference

Welcome to the vue-mount-plugin API reference. This section provides detailed documentation for all exported functions, types, and interfaces.

Overview

vue-mount-plugin exports the following:

Core Functions

FunctionDescription
mount()Create and immediately show a component
createMount()Create an instance without showing

Instance Management

FunctionDescription
getInstances()Get all active instances
getInstanceById()Get instance by ID
unmountAll()Unmount all instances
isMounted()Check if instance is mounted
getActiveInstanceIds()Get all active instance IDs

Singleton Management

FunctionDescription
getSingleton()Get singleton instance by key
setSingleton()Set singleton instance
hasSingleton()Check if singleton exists
removeSingleton()Remove singleton by key
clearSingletons()Clear all singletons

Configuration

FunctionDescription
setGlobalConfig()Set global configuration
globalConfigGlobal configuration object

Composables

FunctionDescription
useMount()Vue 3 composable for instance management
useSingleton()Vue 3 composable for singleton management

Plugin

ExportDescription
MountPluginVue plugin for $show method

Quick Reference

typescript
import {
  // Core
  mount,
  createMount,

  // Instance management
  getInstances,
  getInstanceById,
  unmountAll,
  isMounted,
  getActiveInstanceIds,

  // Singleton
  getSingleton,
  setSingleton,
  hasSingleton,
  removeSingleton,
  clearSingletons,

  // Configuration
  setGlobalConfig,
  globalConfig,

  // Composables
  useMount,
  useSingleton,

  // Plugin
  MountPlugin,

  // Types
  type MountInstance,
  type MountOptions,
  type LifecycleHooks,
  type GlobalConfig,
} from 'vue-mount-plugin'

Released under the MIT License.