vue中局部页面跳转_VUE vue和element框架搭配实现导航跳转,底部导航跳转页面

1、页面代码:

:default-active="activeIndex" router

class="el-menu-demo"

mode="horizontal"

@select="handleSelect"

background-color="#545c64"

text-color="#fff"

active-text-color="#ffd04b">

首页

達豐中国

達豐概况

達豐文化

達豐年鉴

宣传片

export default {

data() {

return {

activeIndex: ‘1‘,

activeIndex2: ‘1‘

};

},

computed:{

},

methods: {

handleSelect(key, keyPath) {

console.log(key, keyPath);

}

}

}

2、在index.js文件里设置跳转地址

import home from ‘@/page/home/home.vue‘

import about from ‘@/page/about/about.vue‘

import culture from ‘@/page/about/culture.vue‘

import history from ‘@/page/about/history.vue‘

import trailer from ‘@/page/about/trailer.vue‘

const routes = [

{

path:‘/‘,

component: home,

},

{

path:‘/home‘,

component: home,

},

{

path:‘/about‘,

component: about,

},

{

path:‘/culture‘,

component: culture,

},

{

path:‘/history‘,

component: history,

},

{

path:‘/trailer‘,

component: trailer,

},

]

export default new Router({

mode:‘history‘, //可以去掉#

linkActiveClass: ‘active‘,

routes

})

3、footer部分代码:

  • 達豐概况
  • 達豐文化
  • 達豐年鉴
  • 宣传片

export default {

data() {

return {

}

},

methods: {

skip(a){

this.$router.push(a)

}

}

}

原文:https://www.cnblogs.com/haimeimei/p/13228353.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值