How to get the background data through vue-router?

Vue rookie, is trying to do a SPA page, encountered a problem looked at a lot of information can not be solved, come here to ask for the opinions of your predecessors.

can vue-router get background data directly? How should it be done? If not, whether to get it through vue-resourse and then put it into vue-router?. If so, what should be done? Thank you very much!

the following is my code. I don"t know whether the idea for
background interface is"/ home", to try to get the information obtained by vue-resource from vue-router

.
var home = {
        template:"<h3></h3>"

      };

      const router = new VueRouter({
        routes:[
          {path:"/home",component:home}
        ]
      })

      new Vue({
        el:"-sharpapp",
        router,
        dataGroup:[],
        methods:{
          renderArticle(url){
            this.$http.get(url,{

            }).then((res)=>{
              this.dataGroup = res.data;
            },(res)=>{
              alert(res.status)
            })
          }
        },
        created(){
          this.renderArticle("/home")
        }
      })

use axios to get it, why use vue-router to get data (I've never seen this usage before)?


vue-router is a route. It can be understood that the url, of the page is not the url, for you to obtain backend data.
to distinguish their relationship,
vue-resourse, officials seem to have given up maintenance. It is recommended to use axios,


first you need to start a service, and then url needs to write an absolute address. Take a look at the backend in front of the manual single page:
https://codeshelper.com/a/11.

.
Menu