5***@qq.com
5***@qq.com
  • 发布:2023-07-24 17:38
  • 更新:2023-07-24 17:38
  • 阅读:175

引入原生插件 报Property 'onKeep' does not exist on type 'void'.

分类:uni-app

引入了插件(https://ext.dcloud.net.cn/plugin?id=11765),云打包时报错

Property 'onKeep' does not exist on type 'void'.
[HBuilder] 17:36:38.294 113 | */
[HBuilder] 17:36:38.294 114 | console.log("#####", keepAlive)
[HBuilder] 17:36:38.302 > 115 | keepAlive.onKeep({
[HBuilder] 17:36:38.303 | ^
[HBuilder] 17:36:38.310 116 | title: "金赛常驻通知",
[HBuilder] 17:36:38.310 117 | content: "金赛进行中"
[HBuilder] 17:36:38.319 118 | },
[HBuilder] 17:36:38.319 ERROR Build failed with errors.

<script lang="ts">  
  import Vue from 'vue';  
  import {  
    http  
  } from './gloabl/http.js';  
  import store from './plugIn/store';  
  const keepAlive = uni.requireNativePlugin('Ba-KeepAliveSuit');  

  export default Vue.extend({  
    globalData: {  
      pushData: null,  
      appInfo: {  
        versionName: null,  
        versionCode: null,  
        appName:null,  
        description: null  
      }  
    },  
    methods: {  

    },  
    mpType: 'app',  
    onLaunch() {  
      console.log('App Launch');  
    },  
    onShow() {  
      console.log('App Show')  
      /**  
       * 保持活跃  
       */  
      console.log("#####", keepAlive)  
      keepAlive.onKeep({  
        title: "金赛常驻通知",  
        content: "金赛进行中",  
        isRogue: true  
      },  
      (res) => {  
        console.log(res);  
        return res  
      });  
    },  
    onHide() {  
      console.log('App Hide')  
    }  
  });  
</script>  
2023-07-24 17:38 负责人:无 分享
已邀请:

要回复问题请先登录注册