1. Load whole data from one json file with fetch api
// Use ES7 Await/Async
async ngOnInit() {
const menuListObj = await(await fetch('assets/data/dashboard.json')).json();
}
本文共 236 字,大约阅读时间需要 1 分钟。
1. Load whole data from one json file with fetch api
// Use ES7 Await/Async
}
转载于:https://www.cnblogs.com/juliazhang/p/10966246.html