DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
LANRE OLANLOKUN
LANRE OLANLOKUN

Posted on • Updated 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 doesn't have this helper out of the box, the only sure way to get this done in VUEJS is by using the browser's default "document object".

Let's see How

  • Open your VUEJS SFC (Single File Component).
  • Navigate to the script tag.
  • Write the _created/mounted hook _if it doesn't 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

Top comments (0)

Visualizing Promises and Async/Await 🀯

async await

☝️ Check out this all-time classic DEV post