菜鸡
菜鸡
  • 发布:2019-08-28 10:27
  • 更新:2019-08-28 10:27
  • 阅读:1463

【报Bug】在uni-app中使用typescript编写uni.getSetting出问题

分类:uni-app

代码如下

uni.getSetting({  
   success(res) {  
      console.log(res.authSetting)  
   }  
})

因为在@dcloudio/types/uni-app中对于GetSettingOptions的定义如下

  
interface GetSettingOptions {  
    /**  
     * 接口调用成功的回调函数  
     */  
    success?: () => void;  
    /**  
     * 接口调用失败的回调函数  
     */  
    fail?: (result: AuthSetting) => void;  
    /**  
     * 接口调用结束的回调函数(调用成功、失败都会执行)  
     */  
    complete?: () => void;  
}  

success没有参数

所以在typescript编译阶段就报错了

2019-08-28 10:27 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复