NervJS / nerv

A blazing fast React alternative, compatible with IE8 and React 16.
https://nerv.aotu.io
MIT License
5.42k stars 267 forks source link

nerv和百度地图js sdk 一起使用的时候会死循环 #162

Closed KevinGong2013 closed 4 years ago

KevinGong2013 commented 4 years ago

文件 packages/nerv/src/event.ts

/* istanbul ignore next */

function stopPropagation () {

  this.cancelBubble = true

  this.stopImmediatePropagation()

}

百度地图jssdk 是这么写的

Event.prototype.__defineSetter__("cancelBubble", function(e) {
            if (e) {
                this.stopPropagation()
            }
            return e
})