use-dynamic-mount
v1.0.7
Published
#### Installtion
Downloads
85
Maintainers
Readme
动态挂载 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 | extend 组件默认配置 | Record<string, any> | {} |