我不断收到此错误:
> TypeScript error: Property 'app' does not exist on type 'Navigator'
在使用此代码时:
navigator.app.exitApp();
我有以下插件:
> <plugin name="cordova-plugin-device" spec="~1.1.2"/>
> <plugin name="cordova-plugin-console" spec="~1.0.3"/>
> <plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
> <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
> <plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
> <plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
我的代码可能出什么问题了?
只需将应用程序属性添加到导航器界面
interface Navigator {
app: {
exitApp: () => any; // Or whatever is the type of the exitApp function
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句