Skip to content

Commit

Permalink
feat: 支持parent参数
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgx committed Jan 20, 2024
1 parent 565186e commit e365d1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-dynamic-mount",
"version": "1.0.4",
"version": "1.0.5",
"main": "dist/index.esm.js",
"module": "dist/index.esm.js",
"browser": "dist/index.umd.js",
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface DynamicMountOptions {
name?: string
className?: string
extend?: any
parent?: any
defaultOption?: Record<string, any>
nextTick?: () => void
}
Expand All @@ -19,6 +20,7 @@ export default () => ({
name = '$dynamicMount',
className = 'dynamic-element',
extend,
parent,
nextTick,
defaultOption = {}
} = options || {}
Expand All @@ -27,6 +29,7 @@ export default () => ({
Vue.prototype[name] = (options: any): MountReturnValue => {
const DynamicComponent = Vue.extend(extend)
const app = new DynamicComponent({
parent,
data: () => ({
...defaultOption,
...options,
Expand Down

0 comments on commit e365d1d

Please sign in to comment.