一、前言
项目开发过程中,需要实现数据的全局存储、获取及删除操作。可通过storage
、globalData
实现。
二、setstorage
为此,阅读了uni-app
官方文档,发现其已经内置方法实现以上功能。
2.1 应用示例
<template>
<view class="content">
<button type="primary" @click="setStorage">存储数据</button>
<button type="primary" @click="getStorage">获取数据</button