storage.axml 1.3 KB

1234567891011121314151617181920212223242526272829
  1. <view class="page">
  2. <view class="page-description">数据存储 API</view>
  3. <view class="page-section">
  4. <view class="page-section-demo">
  5. <input type="text" placeholder="key" name="key" value="{{key}}" onInput="keyChange"></input>
  6. <input type="text" placeholder="data" name="data" value="{{data}}" onInput="dataChange"></input>
  7. </view>
  8. <view class="page-section-btns">
  9. <view onTap="setStorage">存储数据</view>
  10. <view onTap="getStorage">读取数据</view>
  11. <view onTap="removeStorage">删除数据</view>
  12. <view onTap="clearStorage">清除数据</view>
  13. <view onTap="getStorageInfo">获取数据信息</view>
  14. </view>
  15. </view>
  16. <view class="page-section">
  17. <view class="page-section-demo">
  18. <input type="text" placeholder="key" name="keySync" value="{{keySync}}" onInput="keyChangeSync"></input>
  19. <input type="text" placeholder="data" name="dataSync" value="{{dataSync}}" onInput="dataChangeSync"></input>
  20. </view>
  21. <view class="page-section-btns">
  22. <view onTap="setStorageSync">同步存储数据</view>
  23. <view onTap="getStorageSync">同步读取数据</view>
  24. <view onTap="removeStorageSync">同步删除数据</view>
  25. <view onTap="clearStorageSync">同步清除数据</view>
  26. <view onTap="getStorageInfoSync">同步获取数据信息</view>
  27. </view>
  28. </view>
  29. </view>