当我在setInterval中删除localStorage时

时间:2016-12-21 03:19:08

标签: javascript vue.js

 mounted(){
        setInterval(()=>{
          if(localStorage.isverify){
            alert(localStorage.isverify)
              delete localStorage.isverify
                this.datalistp = 1;
                this.datalist = [];
                this.loadRecommend();
             return;
          }
        },2000)

当我在vue.js中使用此功能时 删除localStorage.isverify

后,该页面中的alert()仍会在此页面中发出警报

0 个答案:

没有答案