zoukankan      html  css  js  c++  java
  • Vue之七导航守卫

    {
     		path:'/',component:Recommend,beforeEnter: (to, from, next) => {
    			console.log(to);
    			ajax('get','/api/mall/categoryList',true,'',res=>{
    				var data=res.data;
    				if(data[0].categoryName=="推荐"){
    					next({path:'/Recommend',query:{categoryId:data[0].categoryId}})
    				}else if(data[0].categoryName=="房卡"){
    					next({path:'/RoomCard',query:{categoryId:data[0].categoryId}})
    				}else if(data[0].categoryName=="钻石"){
    					next({path:'/Diamonds',query:{categoryId:data[0].categoryId}})
    				}else if(data[0].categoryName=="金币"){
    					next({path:'/Gold',query:{categoryId:data[0].categoryId}})
    				}else if(data[0].categoryName=="礼包"){
    					next({path:'/Package',query:{categoryId:data[0].categoryId}})
    				}else if(data[0].categoryName=="道具"){
    					next({path:'/Prop',query:{categoryId:data[0].categoryId}})
    				}
    			})
          }
     	},
    

      

  • 相关阅读:
    子网掩码的作用与IP网段的划分
    DHCP服务器
    Anaconda安装、更新第三方包
    time模块的使用
    TensorFlow安装
    机器学习-线性回归
    机器学习
    Pyhton-类(2)
    python-类(1)
    Python-函数
  • 原文地址:https://www.cnblogs.com/yiyi17/p/8311764.html
Copyright © 2011-2022 走看看