【发布时间】:2023-03-24 16:36:01
【问题描述】:
我有一个像 json 这样的文件
[{
"id": "1",
"title": "Abba Father (1)",
"description": "Abba Abba Father."
},
{
"id": "2",
"title": "Abba Father, Let me be (2)",
"description": "Abba Father, Let me be (2) we are the clay."
},
{
"id": "3",
"title": "Abide with me (3)",
"description": "Abide with me (3) we are the clay."
}]
当用户单击主页中的标题列表时,我可以在下一页显示描述。但是在下一页我有下一个和上一个按钮,当用户单击下一个按钮时,我需要显示下一个描述。谁能指导我完成这项任务
我正在使用这个项目来实现它。
https://github.com/kristofferandreasen/simple-ionic-3-app
constructor(
public navCtrl: NavController,
private navParams: NavParams,
// private itemApi: ItemApi
)
{
this.item = this.navParams.data;
console.log(this.item);
console.log(this.item.id)
}
navigatePrivious($event, item)
{
this.navCtrl.push(SingleSongPage, item);
}
navigateNext($event, item)
{
this.navCtrl.push(SingleSongPage, item);
}
【问题讨论】:
-
请给我任何关于 json 格式的建议。我是否有适合此任务的 json 格式?
-
对于未来的问题:屏幕截图和 JSON/数据不如相关代码的最小摘录重要。这将大大提高速度和答案数量;)stackoverflow.com/help/how-to-ask
标签: html json typescript ionic-framework