Skip to content

Commit

Permalink
resolve 1.x event bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xutao15 committed May 9, 2019
1 parent f359776 commit ea03a68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/platforms/mp/compiler/mark-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ function mark (path, options, deps, iteratorArr = []) {
const needEventsID = events || hasModel

if (needEventsID) {
const eventId = getWxEleId(deps.eventIndex, currentArr)
let level = 0
let _path = Object.assign({}, path)
while (_path && _path.parent) {
level++
_path = _path.parent
}
const eventId = getWxEleId(level + '_' + deps.eventIndex, currentArr)
// const eventId = getWxEleId(eIndex, currentArr)
addAttr(path, 'eventid', eventId)
path.attrsMap['data-comkey'] = '{{$k}}'
Expand Down

0 comments on commit ea03a68

Please sign in to comment.