Vue Cli 3 Generated Project Set HTML Title

xspydr picture xspydr · Oct 25, 2018 · Viewed 7.6k times · Source

Currently, after generating a project with Vue CLI 3 the title is "Vue App".

If I set the title in the created hook via document.title the browser will still will flash "Vue App" prior to displaying the title set via document.title.

Looking for a way to set the HTML title for a Vue CLI 3 generated project without it flashing the default "Vue App" title first.

Answer

wwerner picture wwerner · Oct 25, 2018

You can set the title in /public/index.html statically.

Setting it to an empty string in index.html and keeping the update in the hook gets rid of the flashing.