diff --git a/packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js b/packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
index 6eab4f18dbbed24356cd5a201a2999c18a95f1e3..345c51e990313c0b1d7bdc2e6d867fced8a70161 100644
--- a/packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+++ b/packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
@@ -196,6 +196,14 @@ describe('mp:compiler-mp-weixin', () => {
scopedSlotsCompiler: 'augmented'
}
)
+ assertCodegen(
+ '{{getValue(item)}}',
+ '{{$root.m1}}',
+ 'with(this){var m0=$hasScopedSlotsParams("551070e6-2");var m1=m0?getValue($getScopedSlotsParams("551070e6-2","default","item")):null;$mp.data=Object.assign({},{$root:{m0:m0,m1:m1}})}',
+ {
+ scopedSlotsCompiler: 'augmented'
+ }
+ )
assertCodegen(
'',
'',
diff --git a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
index ed8b57f1806fa64463b49fde04b497cc699c7340..0ed4a85e65ee26f51af7c2d3366522be15b32507 100644
--- a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
+++ b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
@@ -74,11 +74,14 @@ function initScopedSlotsParams () {
}
Vue.prototype.$setScopedSlotsParams = function (name, value) {
- const vueId = this.$options.propsData.vueId
- const object = center[vueId] = center[vueId] || {}
- object[name] = value
- if (parents[vueId]) {
- parents[vueId].$forceUpdate()
+ const vueIds = this.$options.propsData.vueId
+ if (vueIds) {
+ const vueId = vueIds.split(',')[0]
+ const object = center[vueId] = center[vueId] || {}
+ object[name] = value
+ if (parents[vueId]) {
+ parents[vueId].$forceUpdate()
+ }
}
}