引入了插件(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>
0 个回复