1.0.5 • Published 4 months ago

use-dynamic-mount v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

动态挂载 vue 组件

Installtion

npm i use-dynamic-mount

Usage

import Vue from 'vue'
import useDynamicMount from 'use-dynamic-mount'

Vue.use(useDynamicMount(), {
  name: '$toast',
  extend: {
    data: () => ({ message: '' }),
    render(h) {
      return h('span', this.message)
    }
  }
})

this.$toast({ message: 'hello world' })

Options

参数名说明类型默认值
name方法名String$dynamicMount
extend挂载的组件 (必填)VNode-
nextTick挂载后的回调Function-
className挂载节点自定义 classStringdynamic-element
defaultOptionextand 组件默认配置Record<string, any>{}

Example

Edit keen-butterfly-f1ml2l