From b18ac8b055af1def5f52fc25950d9a14a58212cc Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 11 May 2018 21:04:42 +0200 Subject: sync tab selection with URL --- src/index.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 8f584ce..3b3839d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,31 @@ import Vue from 'vue'; +import VueRouter from 'vue-router'; import Buefy from 'buefy' import 'buefy/lib/buefy.css' import App from './App.vue'; +import Home from './Home.vue'; +import ReportService from './report-service.js'; + +Vue.use(VueRouter); Vue.use(Buefy); +const reportService = new ReportService(); + +const router = new VueRouter({ + routes: [ { + path: '/', + name: 'home', + component: Home, + props: (route) => ({ + reportService, + }), + } ] +}); + new Vue({ + router, el: '#app', - render: h => h(App) + render: h => h(App), }); -- cgit v1.3.1