// 引用 相对路径 ./xxx/xxx.json 文件 /** xxx.json{n: 13} **/ import(es6) import jsonData from './xxx/xxx.json' //使用 jsonData.n require(node) const jsonData = require('./xxx/xxx.json') //使用 jsonData.n ajax(axios) 异步 axios.get('./xxx/xxx.json').then(res=>{console.log(res)}) 使用 res.data.n