diff options
author | dartcafe <github@dartcafe.de> | 2020-01-10 00:05:39 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-01-10 00:05:39 +0300 |
commit | e1a804fb097f53897599924cbb2354fc2474371d (patch) | |
tree | 955289c859a66ec672582a2c20ce6160cc667a70 /src/js/router.js | |
parent | 5e092d838f26a0694cc7dc0e6fc9d58ab9c95ee3 (diff) |
use @nextcloud/router and some tidy
Diffstat (limited to 'src/js/router.js')
-rw-r--r-- | src/js/router.js | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/js/router.js b/src/js/router.js index 32733299..9eb26428 100644 --- a/src/js/router.js +++ b/src/js/router.js @@ -24,6 +24,7 @@ */ import Vue from 'vue' import Router from 'vue-router' +import { generateUrl } from '@nextcloud/router' // Dynamic loading const List = () => import('./views/PollList') @@ -34,11 +35,11 @@ Vue.use(Router) export default new Router({ mode: 'history', - base: OC.generateUrl(''), + base: generateUrl('/apps/polls'), linkActiveClass: 'active', routes: [ { - path: '/:index(index.php/)?apps/polls', + path: '/', redirect: { name: 'list', params: { @@ -47,16 +48,15 @@ export default new Router({ } }, { - path: '/:index(index.php/)?apps/polls/list/:type?', + path: '/list/:type?', components: { default: List }, - alias: '/:index(index.php/)?apps/polls/', props: true, name: 'list' }, { - path: '/:index(index.php/)?apps/polls/vote/:id', + path: '/vote/:id', components: { default: Vote }, @@ -64,23 +64,7 @@ export default new Router({ name: 'vote' }, { - path: '/:index(index.php/)?apps/polls/vote/:id', - components: { - default: Vote - }, - props: true, - name: 'clone' - }, - { - path: '/:index(index.php/)?apps/polls/vote/:id', - components: { - default: Vote - }, - props: true, - name: 'create' - }, - { - path: '/:index(index.php/)?apps/polls/s/:token', + path: '/s/:token', components: { default: PublicVote }, |