DEV Community

LANRE OLANLOKUN
LANRE OLANLOKUN

Posted on

Adding Title Meta in Vue App

This is going to be a short post.
If you have ever-worked with NUXTJS, you would discover there is a helper method head() that gives access to manipulating HTML Head Metadata Tags, the likes of (meta, title, link) etc., and unlike NUXTJS VUESJS doesnt have this helper out of the box but one of the sure way to get this done in VUEJS is by using the default "document object" that came with our browser.

Let's see How

  • Open your VUEJS SFC (Single File Component).
  • Navigate to the script tag.
  • Write the created/mounted hook if it doesnt exist.
  • Inside the created/mounted hook write.
  • document.title = "Your title". Do this for remaining SFC (.vue files) files in your app.

Thanks for reading

Discussion (0)