VUE 页面的跳转写法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/aduovip/article/details/78135519

在VUE中, 页面的跳转写法

在ajax 请求外写上

let _this = this;

在要跳转的地方写

 _this.$router.push({
     name: 'index'
 })

,

如果没有ajax请求,也可以直接写


this.$router.push({
       name: 'index'

 })

这里 'index' 指在 router-map.js 中 定义的    name:'index',

const routes = [
    {
        path: '/',
        name: 'index',
        meta: {
            title: '样衣管理'
        },
        component: resolve => require(['./components/index.vue'], resolve)
    },
       ....

]

猜你喜欢

转载自blog.csdn.net/aduovip/article/details/78135519
今日推荐