How does vue-resource return get the value?

Boss, let me ask you a question. I am working on a workbench project that requires all data requests to be managed in a js file. I now execute the request data method here, and then I can"t get the value of return. Please help me to see what"s going on. Thank you!

import Vue from "vue"
import VueResource from "vue-resource"
Vue.use(VueResource);
import store from "@/vuex.js";
var datap={
    get:{
        header(){
            var url="static/data/header.json"
            Vue.http.get(url).then((response)=>{
                 var data=JSON.parse(response.bodyText);
                 store.state.homeNav=data.nav;
                store.state.headerUserInfo=data.userInfo;
                store.state.headerMessage=data.message;
                **return data;**        //        
            },error=>{
                //console.log(err);
                //return error.json();
            }).then(result => {
                //console.log(result);
            })
        }
    },
    post:{
        
    }    
}
export {datap};
Jun.30,2021

there is no callback for this method, only then to get the returned value:

var test=Vue.http.get(url).then((response)=>{
    ----------
    //return data;       //return
    return Promise.resolve(data) // Promise
},error=>{
    //console.log(err);
    //return error.json();
}).then(result => {
    //resultPromise.resolve(data)
    //console.log(result);
})

you can see here that you are not familiar with the chained writing of then . It is recommended that you take a look at ES6 new syntax Promise , and try not to use the original callback hell

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b335a8-40415.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b335a8-40415.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?