从外部json文件Vue.JS中读取文件

时间:2019-04-13 17:28:43

标签: javascript json vue.js

我想使用json外部文件中的一些基本url并放入我的JavaScript代码中。需要您的帮助怎么做?

这是我的json文件

const objWithUndefinedValues = {
  a: undefined,
  b: 2,
  c: "3"
}

const undefinedKeys = Object.entries(objWithUndefinedValues)
  .filter(([, value]) => value === undefined)
  .map(([key, ]) => key)

console.log(undefinedKeys);

这是我要实现的代码

{
    "baseUrl":"http://localhost:5000"
}

任何回应将不胜感激。预先感谢

0 个答案:

没有答案