zoukankan      html  css  js  c++  java
  • vuecli4 vue3.0改变路径为hash路径

    history: createWebHashHistory(process.env.BASE_URL), hash 路由

    createWebHistory history 路由

    createMemoryHistory 带缓存 history 路由

    parseQuery 查询参数反序列化

    stringifyQuery 查询参数序列化

    onBeforeRouteLeave 路由离开钩子

    import { createRouter, createWebHashHistory } from 'vue-router'
    import Home from '../views/Home.vue'
    
    const routes = [
      {
        path: '/',
        name: 'Home',
        component: Home,
        meta:{
          title:'home'
        }
      },
      {
        path: '/about',
        name: 'About',
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
      }
    ]
    
    const router = createRouter({
      
      history: createWebHashHistory(process.env.BASE_URL),
      routes,
    
    })
    
    export default router

    转载链接:https://www.jianshu.com/p/2b7001c0b6e0

  • 相关阅读:
    关于asp.netCore3.0区域和路由配置
    用Autofac替换.net core 内置容器
    C#Assembly详解
    MongoDB
    Python
    Python,正则表达式
    Python
    Python
    Gevent和猴子补丁
    Django
  • 原文地址:https://www.cnblogs.com/lst619247/p/13603402.html
Copyright © 2011-2022 走看看