0
点赞
收藏
分享

微信扫一扫

uniappx数据存储,设置缓存,获取缓存,uni.setStorageSync,uni.getStorageSync

type Yonghu = {
					id : string
					nicheng : string
					miyue : string
				}

				let yonghu2 : Yonghu = {
					id: '1237',
					nicheng: '566',
					miyue: '789'
				}
				uni.setStorageSync('yonghu3', yonghu2);
				console.log('==已存放===')

let yonghu2 = uni.getStorageSync('yonghu3');
				if (yonghu2 == '') {
					console.log('==不存在=', yonghu2)
				} else {
					// console.log('==kong==2=', yonghu2)
					let yy = yonghu2 as UTSJSONObject
					console.log('==kong==2=', yy.getString("id"))
				}

举报

相关推荐

0 条评论