Parent path is automatically removed from URL in VueJsHow do I remove a property from a JavaScript object?Remove empty elements from an array in JavascriptHow do I remove a key from a JavaScript object?How do I remove a particular element from an array in JavaScript?Remove duplicate values from JS arrayVue.js - Making helper functions globally available to single-file componentsVuex this.$store is undefined in child componentVue router link add object in the urlVue router does not render/mount root path componentHow to show navbar element only on certain Vue.js components?
When does order matter in probability?
What quests do you need to stop at before you make an enemy of a faction for each faction?
Why do the Brexit opposition parties not want a new election?
Friend is very nit picky about side comments I don't intend to be taken too seriously
How to apply a register to a command
How is the phase of 120V AC established in a North American home?
Why can't some airports handle heavy aircraft while others do it easily (same runway length)?
More than three domains hosted on the same IP address
Relationship between speed and cadence?
How to accelerate progress in mathematical research
Examples where "thin + thin = nice and thick"
Male viewpoint in an erotic novel
Are fast interviews red flags?
Why are some hotels asking you to book through Booking.com instead of matching the price at the front desk?
What makes an ending "happy"?
Contractor cut joist hangers to make them fit
Poor management handling of recent sickness and how to approach my return?
How do draw effects during the discard phase work?
Is there some sort of French saying for "a person's signature move"?
How do English-speaking kids loudly request something?
What is the "Brake to Exit" feature on the Boeing 777X?
Round away from zero
pipe command output to convert?
Short story: Interstellar inspector senses "off" nature of planet hiding aggressive culture
Parent path is automatically removed from URL in VueJs
How do I remove a property from a JavaScript object?Remove empty elements from an array in JavascriptHow do I remove a key from a JavaScript object?How do I remove a particular element from an array in JavaScript?Remove duplicate values from JS arrayVue.js - Making helper functions globally available to single-file componentsVuex this.$store is undefined in child componentVue router link add object in the urlVue router does not render/mount root path componentHow to show navbar element only on certain Vue.js components?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have this weird problem with VueJs2 (cli 3) version, which is that Vue automatically removes parent path from URL.
I have following routes in routes.js file
import Home from "../views/Home";
import Login from "../views/Login";
const router = [
path: '/wh',
component:
template: '<router-view></router-view>'
,
children: [
path: "/home",
name: "home",
component: Home
,
path: "/login",
name: "login",
component: Login
,
],
,
];
export default router;
And this is my router.js file
import Vue from "vue";
import Router from "vue-router";
import routes from './routes'
Vue.use(Router);
const router = new Router(
mode: 'history',
routes: routes,
scrollBehavior(to, from, savedPosition)
return x: 0, y: 0
);
My main.js where I include router
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
new Vue(
store,
router,
render: h => h(App)
).$mount("#app");
And my vue.config.js
module.exports =
devServer:
proxy: "http://my.app.test"
,
outputDir: "public/assets/myApp/app/",
filenameHashing: true,
runtimeCompiler: true,
productionSourceMap: true,
;
The problem is following. /wh
is always missing in url param. What ever I click or do I get automatically redirected to login page /wh
is missing and my app is working flawlessly. I have already tried to set publicPath: '/wh'
in vue.config.js
and everything was working same as now. So how to properly configure my routes so I will see /wh
in my URL, before other children paths?
If you need any additional information's, please let me know and I will provide. Thank you!
javascript vue.js
add a comment |
I have this weird problem with VueJs2 (cli 3) version, which is that Vue automatically removes parent path from URL.
I have following routes in routes.js file
import Home from "../views/Home";
import Login from "../views/Login";
const router = [
path: '/wh',
component:
template: '<router-view></router-view>'
,
children: [
path: "/home",
name: "home",
component: Home
,
path: "/login",
name: "login",
component: Login
,
],
,
];
export default router;
And this is my router.js file
import Vue from "vue";
import Router from "vue-router";
import routes from './routes'
Vue.use(Router);
const router = new Router(
mode: 'history',
routes: routes,
scrollBehavior(to, from, savedPosition)
return x: 0, y: 0
);
My main.js where I include router
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
new Vue(
store,
router,
render: h => h(App)
).$mount("#app");
And my vue.config.js
module.exports =
devServer:
proxy: "http://my.app.test"
,
outputDir: "public/assets/myApp/app/",
filenameHashing: true,
runtimeCompiler: true,
productionSourceMap: true,
;
The problem is following. /wh
is always missing in url param. What ever I click or do I get automatically redirected to login page /wh
is missing and my app is working flawlessly. I have already tried to set publicPath: '/wh'
in vue.config.js
and everything was working same as now. So how to properly configure my routes so I will see /wh
in my URL, before other children paths?
If you need any additional information's, please let me know and I will provide. Thank you!
javascript vue.js
Try to add inindex.html
in<head>
section<base href="/wh/" />
. I had the same issue and this helped me
– Alexander
Mar 28 at 6:31
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42
add a comment |
I have this weird problem with VueJs2 (cli 3) version, which is that Vue automatically removes parent path from URL.
I have following routes in routes.js file
import Home from "../views/Home";
import Login from "../views/Login";
const router = [
path: '/wh',
component:
template: '<router-view></router-view>'
,
children: [
path: "/home",
name: "home",
component: Home
,
path: "/login",
name: "login",
component: Login
,
],
,
];
export default router;
And this is my router.js file
import Vue from "vue";
import Router from "vue-router";
import routes from './routes'
Vue.use(Router);
const router = new Router(
mode: 'history',
routes: routes,
scrollBehavior(to, from, savedPosition)
return x: 0, y: 0
);
My main.js where I include router
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
new Vue(
store,
router,
render: h => h(App)
).$mount("#app");
And my vue.config.js
module.exports =
devServer:
proxy: "http://my.app.test"
,
outputDir: "public/assets/myApp/app/",
filenameHashing: true,
runtimeCompiler: true,
productionSourceMap: true,
;
The problem is following. /wh
is always missing in url param. What ever I click or do I get automatically redirected to login page /wh
is missing and my app is working flawlessly. I have already tried to set publicPath: '/wh'
in vue.config.js
and everything was working same as now. So how to properly configure my routes so I will see /wh
in my URL, before other children paths?
If you need any additional information's, please let me know and I will provide. Thank you!
javascript vue.js
I have this weird problem with VueJs2 (cli 3) version, which is that Vue automatically removes parent path from URL.
I have following routes in routes.js file
import Home from "../views/Home";
import Login from "../views/Login";
const router = [
path: '/wh',
component:
template: '<router-view></router-view>'
,
children: [
path: "/home",
name: "home",
component: Home
,
path: "/login",
name: "login",
component: Login
,
],
,
];
export default router;
And this is my router.js file
import Vue from "vue";
import Router from "vue-router";
import routes from './routes'
Vue.use(Router);
const router = new Router(
mode: 'history',
routes: routes,
scrollBehavior(to, from, savedPosition)
return x: 0, y: 0
);
My main.js where I include router
import App from "./App.vue";
import router from "./router/router";
import store from "./store/store";
new Vue(
store,
router,
render: h => h(App)
).$mount("#app");
And my vue.config.js
module.exports =
devServer:
proxy: "http://my.app.test"
,
outputDir: "public/assets/myApp/app/",
filenameHashing: true,
runtimeCompiler: true,
productionSourceMap: true,
;
The problem is following. /wh
is always missing in url param. What ever I click or do I get automatically redirected to login page /wh
is missing and my app is working flawlessly. I have already tried to set publicPath: '/wh'
in vue.config.js
and everything was working same as now. So how to properly configure my routes so I will see /wh
in my URL, before other children paths?
If you need any additional information's, please let me know and I will provide. Thank you!
javascript vue.js
javascript vue.js
asked Mar 28 at 6:11
Valor_Valor_
1,2254 gold badges30 silver badges67 bronze badges
1,2254 gold badges30 silver badges67 bronze badges
Try to add inindex.html
in<head>
section<base href="/wh/" />
. I had the same issue and this helped me
– Alexander
Mar 28 at 6:31
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42
add a comment |
Try to add inindex.html
in<head>
section<base href="/wh/" />
. I had the same issue and this helped me
– Alexander
Mar 28 at 6:31
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42
Try to add in
index.html
in <head>
section <base href="/wh/" />
. I had the same issue and this helped me– Alexander
Mar 28 at 6:31
Try to add in
index.html
in <head>
section <base href="/wh/" />
. I had the same issue and this helped me– Alexander
Mar 28 at 6:31
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42
add a comment |
1 Answer
1
active
oldest
votes
Add in index.html
in <head>
section <base href="/wh/" />
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391145%2fparent-path-is-automatically-removed-from-url-in-vuejs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add in index.html
in <head>
section <base href="/wh/" />
add a comment |
Add in index.html
in <head>
section <base href="/wh/" />
add a comment |
Add in index.html
in <head>
section <base href="/wh/" />
Add in index.html
in <head>
section <base href="/wh/" />
answered Mar 28 at 6:43
AlexanderAlexander
1,1854 silver badges14 bronze badges
1,1854 silver badges14 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391145%2fparent-path-is-automatically-removed-from-url-in-vuejs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try to add in
index.html
in<head>
section<base href="/wh/" />
. I had the same issue and this helped me– Alexander
Mar 28 at 6:31
Yesss, this was it! :D man, unbelievable! :D You should write an answer, so I can accept it. Thank you!
– Valor_
Mar 28 at 6:42