diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-11-12 23:03:06 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-11-12 23:03:06 +0100 |
commit | 77975d53d77ba0c928fa54b6a4771ee3475b6aad (patch) | |
tree | b3a66a8a7bda11e3beb9e4092b06270c62d940e6 | |
parent | b1cc367a0d5aba87c336661a2ee97c2cc8e688bf (diff) |
Use nextcloud-server to fix router base
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | package-lock.json | 13 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/main.js | 3 | ||||
-rw-r--r-- | src/router/index.js | 3 |
4 files changed, 18 insertions, 2 deletions
diff --git a/package-lock.json b/package-lock.json index e47a4c22..0c54ce54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -731,6 +731,11 @@ "to-fast-properties": "^2.0.0" } }, + "@types/jquery": { + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-2.0.51.tgz", + "integrity": "sha512-+vtCjz+pzr5KkaX/GMnVF0YtQqkm+oVcdBH0Q7zCxdwk42c71xJ9hT1b6Mbn4Kf7CAxSHvkWF1LRdpYwUM+pcg==" + }, "@vue/component-compiler-utils": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-2.3.0.tgz", @@ -6156,6 +6161,14 @@ "axios": "^0.18.0" } }, + "nextcloud-server": { + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/nextcloud-server/-/nextcloud-server-0.15.7.tgz", + "integrity": "sha512-MjARpb8LQdOJCf21gVeHu8HVU41L9lOOfMYjw9p1fDqJxlucKenrvRd0tvnp9OBkpJAuBW/A5/wRBbXXe9+r0Q==", + "requires": { + "@types/jquery": "^2.0.50" + } + }, "nextcloud-vue": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/nextcloud-vue/-/nextcloud-vue-0.4.2.tgz", diff --git a/package.json b/package.json index b92c0bd6..527b12e8 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "debounce": "^1.2.0", "ical.js": "^1.3.0", "moment": "^2.22.2", + "nextcloud-server": "^0.15.7", "nextcloud-vue": "^0.4.2", "p-limit": "^2.0.0", "uuid": "^3.3.2", diff --git a/src/main.js b/src/main.js index 797f32dd..831dd5e1 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,7 @@ import App from './App' import router from './router' import store from './store' import { sync } from 'vuex-router-sync' +import { generateFilePath } from 'nextcloud-server/dist/router' /** GLOBAL COMPONENTS AND DIRECTIVE */ import { AppNavigation, DatetimePicker, Multiselect, PopoverMenu } from 'nextcloud-vue' @@ -42,7 +43,7 @@ __webpack_nonce__ = btoa(OC.requestToken) // OC.generateUrl ensure the index.php (or not) // We do not want the index.php since we're loading files // eslint-disable-next-line -__webpack_public_path__ = OC.linkTo('contacts', 'js/') +__webpack_public_path__ = generateFilePath('contacts', '', 'js/') Vue.component('AppNavigation', AppNavigation) Vue.component('DatetimePicker', DatetimePicker) diff --git a/src/router/index.js b/src/router/index.js index 4fff3af6..574407b0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -22,6 +22,7 @@ import Vue from 'vue' import Router from 'vue-router' +import { generateFilePath } from 'nextcloud-server/dist/router' import Contacts from 'Views/Contacts' Vue.use(Router) @@ -30,7 +31,7 @@ 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'), + base: generateFilePath('contacts', '', ''), linkActiveClass: 'active', routes: [ { |