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

fix(mp-weixin): Scoped Slots #1662

上级 0972d19b
...@@ -46,14 +46,15 @@ module.exports = { ...@@ -46,14 +46,15 @@ module.exports = {
if (!state.scopedSlots) { if (!state.scopedSlots) {
state.scopedSlots = {} state.scopedSlots = {}
} }
let componentName = `${ownerName}-${parentName}-${slotName}` const baseName = `${ownerName}-${parentName}-${slotName}`
if (!hasOwn(state.scopedSlots, componentName)) { let componentName = baseName
state.scopedSlots[componentName] = 0 if (!hasOwn(state.scopedSlots, baseName)) {
state.scopedSlots[baseName] = 0
} }
if (state.scopedSlots[componentName]) { if (state.scopedSlots[baseName]) {
componentName = componentName + state.scopedSlots[componentName] componentName = baseName + state.scopedSlots[baseName]
} }
state.scopedSlots[componentName]++ state.scopedSlots[baseName]++
parentNode.attr['generic:scoped-slots-' + slotName] = componentName parentNode.attr['generic:scoped-slots-' + slotName] = componentName
if (!parentNode.attr.generic) { if (!parentNode.attr.generic) {
parentNode.attr.generic = {} parentNode.attr.generic = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册