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;








1















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!










share|improve this question
























  • 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

















1















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!










share|improve this question
























  • 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













1












1








1








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!










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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

















  • 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
















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












1 Answer
1






active

oldest

votes


















1
















Add in index.html in <head> section <base href="/wh/" />






share|improve this answer
























    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
    );



    );














    draft saved

    draft discarded
















    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









    1
















    Add in index.html in <head> section <base href="/wh/" />






    share|improve this answer





























      1
















      Add in index.html in <head> section <base href="/wh/" />






      share|improve this answer



























        1














        1










        1









        Add in index.html in <head> section <base href="/wh/" />






        share|improve this answer













        Add in index.html in <head> section <base href="/wh/" />







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 6:43









        AlexanderAlexander

        1,1854 silver badges14 bronze badges




        1,1854 silver badges14 bronze badges





















            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.




















            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript