summaryrefslogtreecommitdiffstats
path: root/src/router
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-10 18:40:59 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-11 15:31:29 +0200
commit75f0d3c093de01365f85e8e3035291d9a9a8c889 (patch)
treeb84b25a2e6eb16c00a74fd6db8b0f446ef661a03 /src/router
parent3f3ad0eeb8e01fe725a89ad196d23f22ad33de41 (diff)
Vue cleanup and init
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/router')
-rw-r--r--src/router/index.js55
1 files changed, 55 insertions, 0 deletions
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æ <skjnldsv@protonmail.com>
+ *
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+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
+ }
+ ]
+ }
+ ]
+})