From e365d1d505a098172bab464f4a9e1f24572aee08 Mon Sep 17 00:00:00 2001 From: iamgx Date: Sat, 20 Jan 2024 10:55:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81parent=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9dd1bab..253ddd2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 88a6452..d074636 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ export interface DynamicMountOptions { name?: string className?: string extend?: any + parent?: any defaultOption?: Record nextTick?: () => void } @@ -19,6 +20,7 @@ export default () => ({ name = '$dynamicMount', className = 'dynamic-element', extend, + parent, nextTick, defaultOption = {} } = options || {} @@ -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,