AlloyFinger icon indicating copy to clipboard operation
AlloyFinger copied to clipboard

bug: getElemCacheIndex may return null

Open suconghou opened this issue 6 years ago • 0 comments

getElemCacheIndex may return null

vue2 called doUnbindEvent more than once

cause destroyed other instance

https://github.com/AlloyTeam/AlloyFinger/blob/master/vue/alloy_finger.vue.js#L93-L98

 if(!isNaN(index)) {
          var delArr = CACHE.splice(index, 1);
          if(delArr.length && delArr[0] && delArr[0].alloyFinger.destroy) {
            delArr[0].alloyFinger.destroy();
          }
        } 

should be

 if(!isNaN(index) && index!==null) {
          var delArr = CACHE.splice(index, 1);
          if(delArr.length && delArr[0] && delArr[0].alloyFinger.destroy) {
            delArr[0].alloyFinger.destroy();
          }
        } 

suconghou avatar Aug 22 '18 03:08 suconghou