From e990e7a12c3057a945f7d79399d3cd0e620277f4 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 18 Mar 2020 15:21:33 +0800 Subject: [PATCH] build v3 --- packages/uni-app-plus/dist/index.v3.js | 23 +++++++++++++++++-- .../dist/service.runtime.esm.dev.js | 10 ++++++-- .../dist/service.runtime.esm.prod.js | 10 ++++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/packages/uni-app-plus/dist/index.v3.js b/packages/uni-app-plus/dist/index.v3.js index de1a5ff3c..402471cf1 100644 --- a/packages/uni-app-plus/dist/index.v3.js +++ b/packages/uni-app-plus/dist/index.v3.js @@ -7314,9 +7314,20 @@ var serviceContext = (function () { if (webview && !webview.$processed) { wrapper$1(webview); } + let oldSetStyle = webview.setStyle; + var parentWebview = plus.webview.getWebviewById(webview.__uniapp_mask_id); + webview.setStyle = function (style) { + if (style && style.mask) { + parentWebview.setStyle({ + mask: style.mask + }); + delete style.mask; + } + oldSetStyle.call(this, style); + }; return webview - } - + } + function getCurrentSubNVue () { return getSubNVueById(plus.webview.currentWebview().id) } @@ -7754,6 +7765,7 @@ var serviceContext = (function () { `UNIAPP[webview][${webview.id}]:create[${subNVue.id}]:${JSON.stringify(style)}` ); } + delete style.mask; const subNVueWebview = plus.webview.create('', subNVue.id, style, extras); if (isPopup) { @@ -12996,6 +13008,13 @@ var serviceContext = (function () { this.elements.splice(elmIndex, 1); } + removeElementByCid (cid) { + if (!cid) { + return + } + this.elements = this.elements.filter(elm => elm.cid !== cid); + } + push (type, cid, data, options) { const typeData = [cid, data]; if (options) { diff --git a/packages/uni-app-plus/dist/service.runtime.esm.dev.js b/packages/uni-app-plus/dist/service.runtime.esm.dev.js index f5e189bfe..adb17055f 100644 --- a/packages/uni-app-plus/dist/service.runtime.esm.dev.js +++ b/packages/uni-app-plus/dist/service.runtime.esm.dev.js @@ -5618,9 +5618,14 @@ function insertBefore() { } function removeChild(node, child) { - if (child && child._$vd) { - child._$vd.removeElement(child); + if (!child) { + return + } + if (child.__vue__ && child.__vue__._$vd) { + // 根据组件cid删除所有相关element,后续应该建立一套完整的DOM逻辑 + child.__vue__._$vd.removeElementByCid(child.__vue__._$id); } + child._$vd && child._$vd.removeElement(child); } function appendChild() { @@ -6084,6 +6089,7 @@ function createPatchFunction (backend) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { removeAndInvokeRemoveHook(i, rm); } else if (isDef(children = vnode.children)) { + // fixed by xxxxxx // app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找) // 暂时使用 vnode 的 children 递归 rm 掉子 elm for (i = 0; i < children.length; i++) { diff --git a/packages/uni-app-plus/dist/service.runtime.esm.prod.js b/packages/uni-app-plus/dist/service.runtime.esm.prod.js index c2aae2d64..0d3b5231e 100644 --- a/packages/uni-app-plus/dist/service.runtime.esm.prod.js +++ b/packages/uni-app-plus/dist/service.runtime.esm.prod.js @@ -4874,9 +4874,14 @@ function insertBefore() { } function removeChild(node, child) { - if (child && child._$vd) { - child._$vd.removeElement(child); + if (!child) { + return + } + if (child.__vue__ && child.__vue__._$vd) { + // 根据组件cid删除所有相关element,后续应该建立一套完整的DOM逻辑 + child.__vue__._$vd.removeElementByCid(child.__vue__._$id); } + child._$vd && child._$vd.removeElement(child); } function appendChild() { @@ -5302,6 +5307,7 @@ function createPatchFunction (backend) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { removeAndInvokeRemoveHook(i, rm); } else if (isDef(children = vnode.children)) { + // fixed by xxxxxx // app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找) // 暂时使用 vnode 的 children 递归 rm 掉子 elm for (i = 0; i < children.length; i++) { -- GitLab