导航跳转的方法

1、回到首页
 <!-- logo -->

        <img class="logo" @click="gotohome" src="../../assets/images/logo.png" alt />

方法

  gotohome() {
      //点击跳转至首页页面
      // this.$router.go(-1)
      //指定跳转地址
      this.activeIndex = '0'
      this.$router.replace('/')
      this.reload() //重新加载页面
    },
2、跳到下拉列表某页-网址带name-页面会刷新
 <el-submenu index="2">
     <template slot="title">
         <span
               :class="['/guide-alternative','/particulars'].includes($route.path)?'customActive':''"
               >省份另</span>
     </template>
     <el-menu-item
                   index="/guide-alternative#alternative"
                   @click.native="gotoGuide('#alternative')"
                   :class="'/guide-alternative#alternative'==$route.fullPath?'is-active':''"
                   >部门资</el-menu-item>
     <el-menu-item
                   index="/guide-alternative#sales"
                   @click.native="gotoGuide('#sales')"
                   :class="'/guide-alternative#sales'==$route.fullPath?'is-active':''"
                   >产品售</el-menu-item>
     <el-menu-item
                   index="/guide-alternative#openmarket"
                   @click.native="gotoGuide('#openmarket')"
                   :class="'/guide-alternative#openmarket'==$route.fullPath?'is-active':''"
                   >区部场</el-menu-item>
     <el-menu-item
                   index="/guide-alternative#others"
                   @click.native="gotoGuide('#others')"
                   :class="'/guide-alternative#others'==$route.fullPath?'is-active':''"
                   >其他</el-menu-item>
     <iframe class="cover" src="about:blank"></iframe>
 </el-submenu>

方法

    gotoGuide(hash) {
      this.reload()
      // this.fullPaths()
      //this.$router.replace('/guide-alternative'+hash)
    },
      // 进入后台管理
    openAmc() {
      // console.log('123')
      this.$router.push('/admin/index/upload-law')
    },
    // 退出登录
    logout() {
      this.$router.push('/logout')
    },
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐