@bedrock/vue-router

vue-router integration for Vue apps running on Bedrock
Install
npm install @bedrock/vue-router
Latest Version:1.0.0
Vue:3
License:Apache-2.0
Last Updated:Oct 12, 2026
Links: GitHub  ·  npm
Maintainer: msporny

bedrock-vue-router

vue-router integration for Vue applications running on Bedrock.

This package owns the vue-router peer dependency so that a host application's router major version is independent of @bedrock/vue. It provides augmentRouter, which was part of @bedrock/vue through v5.

Usage

augmentRouter adds the common "not found" route and page title handling to a router created by the host application:

import {augmentRouter} from '@bedrock/vue-router';
import {initialize} from '@bedrock/vue';
import {createRouter, createWebHistory} from 'vue-router';
import MyApp from '../components/MyApp.vue';

initialize({
  async beforeMount({app}) {
    const router = createRouter({
      history: createWebHistory(),
      routes: []
    });
    // adds common functionality like "not found" route
    // and page title setter
    augmentRouter({app, router});
    app.use(router);

    return MyApp;
  }
})

A route may set meta.title to either a string or a function called with {to, from}. A route without one restores the document's original title.

The "not found" route renders NotFound.vue from @bedrock/vue, so this package must be used inside a @bedrock/vue application.

License

Apache License, Version 2.0 Copyright 2011-2026 Digital Bazaar, Inc.

Other Digital Bazaar products are available under a non-commercial license. Please contact Digital Bazaar for details.

Commercial licensing and support are available by contacting Digital Bazaar support@digitalbazaar.com.

Related Packages

form-wallet-web

form-wallet-web

1,976
web
@web-types/vue-router

Web-types for vue-router

1,340,437 306
@fastkit/vue-location

vue-location

5,514 6
vue-routes-design

简化vue-router的路由配置

914 5
vuex-router-sync

Effortlessly keep vue-router and vuex store in sync.

4,091,575 2,487

Version History

Version Released Vue License
1.0.0 ^3.5.38 Apache-2.0