From 75f0d3c093de01365f85e8e3035291d9a9a8c889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 10 Jul 2018 18:40:59 +0200 Subject: Vue cleanup and init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/router/index.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/router/index.js (limited to 'src/router') diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 00000000..588b7a10 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,55 @@ +/* + * @copyright Copyright (c) 2018 John Molakvoæ + * + * @author John Molakvoæ + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +import Vue from 'vue' +import Router from 'vue-router' +import Contacts from '../views/Contacts' + +Vue.use(Router) + +export default new Router({ + mode: 'history', + // if index.php is in the url AND we got this far, then it's working: + // let's keep using index.php in the url + base: OC.generateUrl('/apps/contacts/'), + linkActiveClass: 'active', + routes: [ + { + path: '/', + component: Contacts, + props: true, + name: 'root', + children: [ + { + path: ':selectedGroup', + name: 'group', + component: Contacts + }, + { + path: ':selectedGroup/:selectedContact', + name: 'contact', + component: Contacts + } + ] + } + ] +}) -- cgit v1.2.3