我想返回一个json对象并读取ip地址
//This is the object in json file
{"ip":"http://localhost:8080"}
例如,我想要
import urlAddress from './url.json';
const url = //the json value;
console.log(url);
答案 0 :(得分:0)
objects.json
export default {
"ip":"127.0.0.1"
}
app.js
import objects from './objects'
console.log(objects.ip) // output: 127.0.0.1