Vue项目的核心功能就是Vue-router和axios,Vue-router是路由工具,用来在不同页面间跳转,而axios是ajax请求工具,用来向服务器发送ajax请求。

 

 

goto() {
      this.$router.go(-1)
    },
   myself() {
      this.$router.push({
        name: '修改信息'
      })
    },
    myselfIndex() {
      this.$router.push({
        name: '首页'
      })
    },

路由设置 

import Vue from 'vue'
import Router from 'vue-router'
import tree from '@/page/tree'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'tree',
 
    component: () => import('@/page/tree.vue')
  }]
})

 

 

import Vue from 'vue'
import Router from 'vue-router'
import tree from '@/page/tree'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'tree',
    component: tree 
  }]
})

 

export default new Router({
  routes: [{
    path: '/',
    name: 'tree',
    component: () => import('@/page/tree')
  }]
})