1***@qq.com
1***@qq.com
  • 发布:2024-10-09 14:44
  • 更新:2024-10-09 14:44
  • 阅读:70

Cannot use 'T' as reified type parameter. Use a class instead.

分类:uni-app x

为啥会报这个错呢

function getStorage<T>(key: string): T | null {  
    let parseObj: T | null = null  
    const storageValue: string = uni.getStorageSync(key) as string  
    if (storageValue != null) {  
        parseObj = JSON.parse<T>(storageValue)  
    }  
    return parseObj  
}
2024-10-09 14:44 负责人:无 分享
已邀请:

要回复问题请先登录注册