我在Ionic 3应用程序中使用了离子母语linkedin插件。
我的代码:
var scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
this.linkedin.login(scopes, true).then((res) => {
console.log(res) ;
}, (err) => {
console.log(err) ;
});我有个错误:
类型'string[]‘的参数不能分配给'LinkedInLoginScopes[]’类型的参数。输入“string”不能输入'LinkedInLoginScopes‘。
请帮帮我。
发布于 2017-07-26 09:42:04
您需要定义scopes的类型。
插件包装器中scopes参数的类型
导出类型为LinkedInLoginScopes = 'r_basicprofile‘\’\ 登录(作用域: LinkedInLoginScopes[],promptToInstall: boolean):承诺{返回;}
let scopes:any = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];或
let scopes:Array<string> = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
this.linkedin.login(scopes, true).then((res) => {
console.log(res) ;
}, (err) => {
console.log(err) ;
});发布于 2017-11-07 12:04:43
将其定义如下:
scopes: LinkedInLoginScopes[] = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];https://stackoverflow.com/questions/45322458
复制相似问题