getLength 的同步版本,获取本地存储数据的项数。
getLength
包含存储项数的操作结果。
const result = getLengthSync();if (result.isOk()) { console.log('存储项数:', result.unwrap());} Copy
const result = getLengthSync();if (result.isOk()) { console.log('存储项数:', result.unwrap());}
getLength的同步版本,获取本地存储数据的项数。