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

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

 

Wxml:

<button type="primary" class="clear" 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();

            }

        });

    },

文章来源:刘俊涛的博客

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

猜你喜欢

转载自www.cnblogs.com/lovebing/p/9474308.html