From 72587c5ab1f2f10795f9e9efcb7fafab45bec03f Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 30 Dec 2019 19:11:53 +0800 Subject: [PATCH] build:runtime --- packages/uni-app-plus/dist/index.js | 11 +++++++---- packages/uni-mp-alipay/dist/index.js | 11 +++++++---- packages/uni-mp-baidu/dist/index.js | 11 +++++++---- packages/uni-mp-qq/dist/index.js | 11 +++++++---- packages/uni-mp-toutiao/dist/index.js | 11 +++++++---- packages/uni-mp-weixin/dist/index.js | 11 +++++++---- 6 files changed, 42 insertions(+), 24 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 48020098..69ec399a 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1211,12 +1211,15 @@ const mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__']; function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index 8e18e39b..cb227d7b 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -1643,12 +1643,15 @@ function parseBaseApp (vm, { function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index bf79c194..0bbf1486 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -1347,12 +1347,15 @@ function parseBaseApp (vm, { function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index 2cba707f..fcdf9022 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -1271,12 +1271,15 @@ const mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__']; function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 4c738a88..40fc9dfe 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -1356,12 +1356,15 @@ function parseBaseApp (vm, { function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 5463b4f5..acfc0194 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -1211,12 +1211,15 @@ const mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__']; function findVmByVueId (vm, vuePid) { const $children = vm.$children; - // 优先查找直属 - let parentVm = $children.find(childVm => childVm.$scope._$vueId === vuePid); - if (parentVm) { - return parentVm + // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200) + for (let i = $children.length - 1; i >= 0; i--) { + const childVm = $children[i]; + if (childVm.$scope._$vueId === vuePid) { + return childVm + } } // 反向递归查找 + let parentVm; for (let i = $children.length - 1; i >= 0; i--) { parentVm = findVmByVueId($children[i], vuePid); if (parentVm) { -- GitLab