axios 讀取本地json文件成功后,解析失敗export function getEmojiData() { return axios({ method: 'get', url: '/static/emojiDB.json', responseType:'json', // transformRequest: [function (data, headers) { // // Do whatever you want to transform the data // return JSON.stringify(data); // }], }) .then(function(res) { return Promise.resolve(res.data); });}調(diào)用時 getEmojiData().then((res)=>{ console.log(typeof res) console.log(res); console.log(JSON.parse(res)) })
axios 讀取本地json文件成功后,解析失敗。
翻翻過去那場雪
2019-03-12 21:23:40