From 5fef618300bf8d25ffbe7e7d7cc3796ad054ed32 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Tue, 3 Nov 2020 20:46:39 +0800 Subject: [PATCH] fix(mp-weixin): ref in scoped slots --- src/platforms/mp-weixin/runtime/wrapper/util.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platforms/mp-weixin/runtime/wrapper/util.js b/src/platforms/mp-weixin/runtime/wrapper/util.js index df094fa86..34abec9b1 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/util.js +++ b/src/platforms/mp-weixin/runtime/wrapper/util.js @@ -36,10 +36,12 @@ function selectAllComponents (mpInstance, selector, $refs) { components.forEach(component => { const ref = component.dataset.ref $refs[ref] = component.$vm || component - if (component.dataset.vueGeneric === 'scoped') { - component.selectAllComponents('.scoped-ref').forEach(scopedComponent => { - selectAllComponents(scopedComponent, selector, $refs) - }) + if (__PLATFORM__ === 'mp-weixin') { + if (component.dataset.vueGeneric === 'scoped') { + component.selectAllComponents('.scoped-ref').forEach(scopedComponent => { + selectAllComponents(scopedComponent, selector, $refs) + }) + } } }) } -- GitLab