Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: getElemCacheIndex may return null #122

Open
suconghou opened this issue Aug 22, 2018 · 0 comments
Open

bug: getElemCacheIndex may return null #122

suconghou opened this issue Aug 22, 2018 · 0 comments

Comments

@suconghou
Copy link

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();
          }
        } 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant