小程序清除缓存功能如何实现

醉东枫

关注

阅读 52

2022-05-07

小程序清除缓存功能如何实现

Wxml:

<button type="primary" bindtap="clearStorage" loading="{{loading}}" disabled="{{disabled}}">清空缓存</button>

Js:

clearStorage: function(){

var that = this;

that.setData({

loading:true,

disabled:true

});

that.update();

wx.clearStorage({

success:function(){

that.setData({

loading:false,

disabled:false,

toast1Hidden:false

});

that.update();

}

});

},

欢迎关注,有问题一起学习欢迎留言、评论。

你要保守你心,胜过保守一切。

作者:刘俊涛的博客​​




精彩评论(0)

0 0 举报