vue路由守卫修改浏览器title
vue的单页面应用在某些业务场景下需要展示不同页面的title,可以利用路由守卫完成,
目录结构如下:
代码如下:
index.js
import routes from './router'// 引入路由列表配置
// 全局路由守卫,动态改变tille
router.beforeEach((to, from, next) => {
window.document
vue的单页面应用在某些业务场景下需要展示不同页面的title,可以利用路由守卫完成,
目录结构如下:
代码如下:
index.js
import routes from './router'// 引入路由列表配置
// 全局路由守卫,动态改变tille
router.beforeEach((to, from, next) => {
window.document