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

fix(v3): update scoped slot element id

上级 21608020
...@@ -65,6 +65,9 @@ function updateEleId (el, it, state) { ...@@ -65,6 +65,9 @@ function updateEleId (el, it, state) {
el.ifConditions && el.ifConditions.forEach((con, index) => { el.ifConditions && el.ifConditions.forEach((con, index) => {
index !== 0 && updateEleId(con.block, it, state) index !== 0 && updateEleId(con.block, it, state)
}) })
el.scopedSlots && Object.values(el.scopedSlots).forEach((slot, index) => {
updateEleId(slot, it, state)
})
} }
function getBindingAttr (el, name) { function getBindingAttr (el, name) {
...@@ -119,6 +122,9 @@ function getNewId (id, it) { ...@@ -119,6 +122,9 @@ function getNewId (id, it) {
function updateScopedSlotEleId (el, state) { function updateScopedSlotEleId (el, state) {
// TODO 暂不考虑 scopedSlot 嵌套情况 // TODO 暂不考虑 scopedSlot 嵌套情况
if (el.slotScope) { if (el.slotScope) {
const getNewId = function (id, it) {
return Number.isInteger(id) ? `("${id}-"+${it})` : `(${id}+"-"+${it})`
}
const updateEleId = function (el) { const updateEleId = function (el) {
if (el.type !== 1) { if (el.type !== 1) {
return return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册