【问题标题】:Migrating to Ionic 5 from Ionic 3 operator .then shows error从 Ionic 3 操作员迁移到 Ionic 5。然后显示错误
【发布时间】:2020-08-08 17:39:28
【问题描述】:

您好,我正在尝试将我的项目从 Ionic 3 迁移到 Ionic 5。

我有一个社交分享功能,操作符.then()被红灯了

属性不会在类型 void 上退出

这是一个函数

shareMedia()
{
  this.socialSharing.share(this.title, '', 'https://example.com/api/api/uploads/' + this.image_path, 'https://example.com')
    .then(()=>{
    }).catch(()=>{

    });
}

有什么帮助吗?

【问题讨论】:

  • 取决于this.socialSharing.share() 是什么
  • 你能详细说明 Suraj 吗? npmjs.com/package/@ionic-native/social-sharing
  • 您使用的是哪个版本的离子原生插件,您是如何导入的?
  • “@ionic-native/social-sharing”:“^5.27.0”,通过 npm i
  • 还有你的进口声明?

标签: angular ionic-framework ionic-native ionic5


【解决方案1】:

感谢@Tomas 未来的考虑

改变

import { SocialSharing } from '@ionic-native/social-sharing'; 

import { SocialSharing } from '@ionic-native/social-sharing/ngx';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-12
    • 2020-08-29
    • 2020-03-13
    • 1970-01-01
    • 2020-09-23
    • 2019-11-02
    • 1970-01-01
    • 2019-05-14
    相关资源
    最近更新 更多