Search code examples
vue.jsvue-cli-3

Vue Cli 3 Generated Project Set HTML Title


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.


Solution

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