缓存
1. 设置全局变量
- 名称
set-storage-sync
- 类型
- 执行类
- 参数
key: string
关键字value: any
值
- 返回值
- 无
- 示例
import set_storage_sync from '@feidao/web/atom/wx/app/api/cache/set-storage-sync';
set_storage_sync('username', 'feidao');
2. 获取全局变量
- 名称
get-storage-sync
- 类型
- 执行类
- 参数
key: string
键
- 返回值
any
值
- 示例
import get_storage_sync from '@feidao/web/atom/wx/app/api/cache/get-storage-sync';
get_storage_sync('username');
// feidao
3. 删除全局变量某一个值
- 名称
remove-storage-sync
- 类型
- 执行类
- 参数
key: string
键
- 返回值
- 无
- 示例
import remove_storage_sync from '@feidao/web/atom/wx/app/api/cache/remove-storage-sync';
remove_storage_sync('username');
//
4. 清空全局变量
- 名称
clear-storage-sync
- 类型
- 执行类
-
参数
- 返回值
- 无
- 示例
import clear_storage_sync from '@feidao/web/atom/wx/app/api/cache/clear-storage-sync';
clear_storage_sync();
//