小程序清除緩存功能如何實現


小程序清除緩存功能如何實現

 

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

            }

        });

    },

文章來源:劉俊濤的博客

歡迎關注,有問題一起學習歡迎留言、評論。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM