gpt4 book ai didi

ionic-framework - ionic : where to see the displayed console log

转载 作者:行者123 更新时间:2023-12-03 23:36:19 25 4
gpt4 key购买 nike

我是 ionic 的新手,我正在关注 ionic framework documents学习它。
这是我的方法代码: hello-ionic.ts

  openActionSheet(){
let actionSheet=this.actionsheetCtrl.create(
{
title: 'Modify your album',
cssClass: 'page-hello-ionic',
buttons:[
{
text: 'Delete',
role: 'destructive', //will always sort to be on top
icon: !this.platform.is('ios') ? 'trash' : null,
handler: () => {
console.log('Delete clicked');
}
},
{
text: 'Play',
icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
handler: () => {
console.log('Play clicked');
}
},
{
text: 'Favorite',
icon: !this.platform.is('ios') ? 'heart-outline' : null,
handler: () => {
console.log('Favorite clicked');
}
},
{
text: 'Cancel',
role: 'cancel', // will always sort to be on the bottom
icon: !this.platform.is('ios') ? 'close' : null,
handler: () => {
console.log('Cancel clicked');
}
}
]});
actionSheet.present();
}

该代码工作正常。但我想知道 console.log()在哪里?打印。任何人都可以帮助我吗?

最佳答案

要检查控制台日志,您可以使用浏览器并运行以下命令:
第一步: $ionic serve (将在本地主机上运行您的应用程序)
第 2 步:在您的应用程序运行的相应浏览器(chrome、safari 等...)中,右键 + 单击并检查 您的应用程序如下图所示。
enter image description here
第 3 步:您将在浏览器窗口的右侧和应用程序屏幕的左侧看到一个带有 HTML 元素的窗口。
enter image description here
第 4 步:在右侧窗口中,您可以在顶部栏上找到“控制台”菜单选项。单击它,您将获得您的控制台,您可以在其中找到您的应用程序 日志错误 警告 哪个 ionic 产生的。
enter image description here
enter image description here
编辑:
真机或模拟器调试
查看 real-deviceemulatorgenymotion控制台日志遵循以下步骤和屏幕截图。
第一步:运行此命令以在真实设备或模拟器上运行您的应用

$ionic cordova run android
第 2 步:在设备或模拟器上成功启动应用程序后,转到 Chrome 浏览器并右键单击并单击 “检查”你会在浏览器底部看到下面的屏幕。
enter image description here
第 3 步:点击 “远程设备”将显示连接的真实设备或模拟器列表。
从该设备列表中单击 “检查”该设备名称右侧的按钮(检查相同的屏幕截图)将打开一个带有设备镜像的新窗口,现在控制台是您的调试器。
enter image description here
enter image description here
希望这将帮助您调试您的应用程序。

关于ionic-framework - ionic : where to see the displayed console log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49316634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com