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

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

 

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();

            }

        });

    },

文章来源:刘俊涛的博客

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

posted @ 2018-08-14 14:05  刘俊涛的博客  阅读(9350)  评论(0编辑  收藏  举报