9.1settimeout要用函数闭包/

2017-09-02  本文已影响0人  我爱吃肥肠

1,setTimeout(console.log(_this.$store.state.currentuser.encrypt_key),4000)这样没有效果,改成闭包

setTimeout(function(){

return console.log(_this.$store.state.currentuser.encrypt_key)},4000)

上一篇下一篇

猜你喜欢

热点阅读