最新
我要提问
发布笔记
患了低血糖的狗
1.路由的展示 首页| about页面 | user页面 | 2.获取路径的方法"$route.path 获取当前路由地址:{{ $route.path }} 3.三元运算符展示导航效果 首页| about页面 | user页面 | 4.跳转方法$router.push 点击我跳转User页面 5.全局变量在js里面的使用$router.push 点击我跳转User页面 点击我跳转hone页面 点击我跳转err页面 6.全局变量在js里面实现两个页面来回切换{{ $route.path }} 点击我跳转 7.路由参数 跳转user页面 export default({ data(){ return{ num:0 } }, methods: { G_url(e){ if(e==1){ this.$router.push('/user') }else if(e==2){ this.$router.push('/home') }else{ //this.$router.push('/user') alert('错误!没有该页面') } }, G_url2(e){ if(e==1){ this.num=0; this.$router.push('/user') }else{ this.num=1; this.$router.push('/home') } } }, }) .black{ color:black } .active{ color:green; }
3星期前 0
看过该课程的同学也在学
患了低血糖的狗
1.路由的展示 首页| about页面 | user页面 | 2.获取路径的方法"$route.path 获取当前路由地址:{{ $route.path }} 3.三元运算符展示导航效果 首页| about页面 | user页面 | 4.跳转方法$router.push 点击我跳转User页面 5.全局变量在js里面的使用$router.push 点击我跳转User页面 点击我跳转hone页面 点击我跳转err页面 6.全局变量在js里面实现两个页面来回切换{{ $route.path }} 点击我跳转 7.路由参数 跳转user页面 export default({ data(){ return{ num:0 } }, methods: { G_url(e){ if(e==1){ this.$router.push('/user') }else if(e==2){ this.$router.push('/home') }else{ //this.$router.push('/user') alert('错误!没有该页面') } }, G_url2(e){ if(e==1){ this.num=0; this.$router.push('/user') }else{ this.num=1; this.$router.push('/home') } } }, }) .black{ color:black } .active{ color:green; }
3星期前 0