zoukankan      html  css  js  c++  java
  • vue导航守卫修改标题

    main.js

    // The Vue build version to load with the `import` command
    // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
    import Vue from 'vue'
    import App from './App'
    import router from './router'
    
    Vue.config.productionTip = false
    
    /* eslint-disable no-new */
    new Vue({
      el: '#app',
      router,
      components: {
        App
      },
      template: '<App/>'
    })
    
    router.beforeEach((to, from, next) => {
      console.log("beforeEach");
      console.log(from);
      console.log(to);
      document.title = to.matched[0].name;
      next();
    })
    

    标题修改

  • 相关阅读:
    SharePoint REST API
    线程同步
    win32
    win32
    win32
    win32
    win32
    win32
    win32
    解决CentOS被wbew挖矿程序入侵的方法
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/14990438.html
Copyright © 2011-2022 走看看