use-dynamic-mount
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

动态挂载 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 挂载节点自定义 class String dynamic-element
defaultOption extand 组件默认配置 Record<string, any> {}

Example

Edit keen-butterfly-f1ml2l

Package Sidebar

Install

npm i use-dynamic-mount

Weekly Downloads

24

Version

1.0.6

License

MIT

Unpacked Size

5.03 kB

Total Files

6

Last publish

Collaborators

  • iamgx