微信小程序api视频课程-数据缓存-wx.setStorage 数据存储在本地缓存的使用

微信小程序api视频课程-数据缓存-wx.setStorage 数据存储在本地缓存的使用
设置缓存
微信小程序api视频课程-数据缓存-wx.setStorage 数据存储在本地缓存的使用

wxml代码

<button bindtap="myset01">设置缓存数据</button>

<button bindtap="myset02">设置缓存数据2</button>

js代码

  /**
   * 页面的初始数据
   */
  data: {

  },
  myset01:function(){
    wx.setStorage({
      key: 'k01',
      data: '黄菊华老师',
      success:function(res)
      {
        console.log("缓存数据保存成功")
      }
    })
  },
  myset02: function () {
    wx.setStorage({
      key: 'k-abc',
      data: '浙江杭州',
      success: function (res) {
        console.log("缓存数据保存成功222")
      }
    })
  },  

欢迎大家收看我的****:微信小程序常用API使用
https://edu.csdn.net/course/detail/16194
微信小程序api视频课程-数据缓存-wx.setStorage 数据存储在本地缓存的使用