尝试这个:
const data = require("../data/transportationDataCheck.json")
console.log(JSON.stringify(data));
或者您可以在更改少量网址后尝试
let transportation = [];
const init = () => {
fetch('../data/transportationDataCheck.json')
.then((response) => {
return response.json();
})
.then((data) => {
transportation = data;
}).then(() => {
renderList(transportation);
});
};
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句