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

 

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

            }

        });

    },

文章来源:刘俊涛的博客

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

版权声明:本文为lovebing原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/lovebing/p/9474308.html