Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « router « design_management « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7dc92f55d47acc6ece7f01c3a0a21a0a80bd82d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import $ from 'jquery';
import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';

Vue.use(VueRouter);

export default function createRouter(base) {
  const router = new VueRouter({
    base,
    mode: 'history',
    routes,
  });

  router.beforeEach(({ meta: { el } }, from, next) => {
    $(`#${el}`).tab('show');

    next();
  });

  return router;
}