diff --git a/packages/uni-mp-weixin/lib/uni.compiler.js b/packages/uni-mp-weixin/lib/uni.compiler.js index d70bf8b49df78977e4d80123658bb6ec8040bf86..f6d43229caf943608b6403bc7a9e6937ff2e24cd 100644 --- a/packages/uni-mp-weixin/lib/uni.compiler.js +++ b/packages/uni-mp-weixin/lib/uni.compiler.js @@ -46,14 +46,15 @@ module.exports = { if (!state.scopedSlots) { state.scopedSlots = {} } - let componentName = `${ownerName}-${parentName}-${slotName}` - if (!hasOwn(state.scopedSlots, componentName)) { - state.scopedSlots[componentName] = 0 + const baseName = `${ownerName}-${parentName}-${slotName}` + let componentName = baseName + if (!hasOwn(state.scopedSlots, baseName)) { + state.scopedSlots[baseName] = 0 } - if (state.scopedSlots[componentName]) { - componentName = componentName + state.scopedSlots[componentName] + if (state.scopedSlots[baseName]) { + componentName = baseName + state.scopedSlots[baseName] } - state.scopedSlots[componentName]++ + state.scopedSlots[baseName]++ parentNode.attr['generic:scoped-slots-' + slotName] = componentName if (!parentNode.attr.generic) { parentNode.attr.generic = {}