提交 e990e7a1 编写于 作者: fxy060608's avatar fxy060608

build v3

上级 a924e69c
...@@ -7314,9 +7314,20 @@ var serviceContext = (function () { ...@@ -7314,9 +7314,20 @@ var serviceContext = (function () {
if (webview && !webview.$processed) { if (webview && !webview.$processed) {
wrapper$1(webview); 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 return webview
} }
function getCurrentSubNVue () { function getCurrentSubNVue () {
return getSubNVueById(plus.webview.currentWebview().id) return getSubNVueById(plus.webview.currentWebview().id)
} }
...@@ -7754,6 +7765,7 @@ var serviceContext = (function () { ...@@ -7754,6 +7765,7 @@ var serviceContext = (function () {
`UNIAPP[webview][${webview.id}]:create[${subNVue.id}]:${JSON.stringify(style)}` `UNIAPP[webview][${webview.id}]:create[${subNVue.id}]:${JSON.stringify(style)}`
); );
} }
delete style.mask;
const subNVueWebview = plus.webview.create('', subNVue.id, style, extras); const subNVueWebview = plus.webview.create('', subNVue.id, style, extras);
if (isPopup) { if (isPopup) {
...@@ -12996,6 +13008,13 @@ var serviceContext = (function () { ...@@ -12996,6 +13008,13 @@ var serviceContext = (function () {
this.elements.splice(elmIndex, 1); this.elements.splice(elmIndex, 1);
} }
removeElementByCid (cid) {
if (!cid) {
return
}
this.elements = this.elements.filter(elm => elm.cid !== cid);
}
push (type, cid, data, options) { push (type, cid, data, options) {
const typeData = [cid, data]; const typeData = [cid, data];
if (options) { if (options) {
......
...@@ -5618,9 +5618,14 @@ function insertBefore() { ...@@ -5618,9 +5618,14 @@ function insertBefore() {
} }
function removeChild(node, child) { function removeChild(node, child) {
if (child && child._$vd) { if (!child) {
child._$vd.removeElement(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() { function appendChild() {
...@@ -6084,6 +6089,7 @@ function createPatchFunction (backend) { ...@@ -6084,6 +6089,7 @@ function createPatchFunction (backend) {
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm); removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) { } else if (isDef(children = vnode.children)) {
// fixed by xxxxxx
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找) // app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm // 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) { for (i = 0; i < children.length; i++) {
......
...@@ -4874,9 +4874,14 @@ function insertBefore() { ...@@ -4874,9 +4874,14 @@ function insertBefore() {
} }
function removeChild(node, child) { function removeChild(node, child) {
if (child && child._$vd) { if (!child) {
child._$vd.removeElement(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() { function appendChild() {
...@@ -5302,6 +5307,7 @@ function createPatchFunction (backend) { ...@@ -5302,6 +5307,7 @@ function createPatchFunction (backend) {
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm); removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) { } else if (isDef(children = vnode.children)) {
// fixed by xxxxxx
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找) // app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm // 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) { for (i = 0; i < children.length; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册