From 9111584dde41efa121efcf68fea9b2084b9bbefd Mon Sep 17 00:00:00 2001 From: "Mr.Z" Date: Wed, 9 Jan 2019 14:31:28 +0800 Subject: [PATCH] fix: e.path and cloneDeep --- package.json | 2 +- src/combo/frame/frame.vue | 2 +- src/core/draggable.vue | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b9d12ea..ea74683 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wya-vm", - "version": "0.0.14", + "version": "0.1.0", "description": "", "main": "dist/vm.min.js", "files": [ diff --git a/src/combo/frame/frame.vue b/src/combo/frame/frame.vue index da870a1..de7e17d 100644 --- a/src/combo/frame/frame.vue +++ b/src/combo/frame/frame.vue @@ -100,7 +100,7 @@ export default { let index = this.dataSource.length; // 会同步到上级 这里不用this.$emit("update:sync") this.dataSource.push({ - ...result.data, + ...cloneDeep(result.data), module: mod, id, x: mouseX - x, diff --git a/src/core/draggable.vue b/src/core/draggable.vue index b4da676..560adf3 100644 --- a/src/core/draggable.vue +++ b/src/core/draggable.vue @@ -296,10 +296,11 @@ export default { className: /handle-([(top|right|-|bottom|left)]{2})/ }; + let path = e.path || (e.composedPath && e.composedPath()) || []; if ( !this.$el.contains(target) && !eleInRegExp(target, regex) - && (!e.path.some(item => eleInRegExp(item, this.editorRegExp))) + && (!path.some(item => eleInRegExp(item, this.editorRegExp))) ) { if (this.active) { // 解绑