Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bachdgvn/vue-router-meta-tags

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bachdgvn/vue-router-meta-tags

The simple callback to update the page title and metadata on route change for vue-router

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-router-meta-tags

The simple callback to update the page title and metadata on route change for vue-router.

Installing

npm install @bachdgvn/vue-router-meta-tags

Usage

Open router.js, and edit your router. Make sure you placed title, metaTags for each route in routes.

import Vue from 'vue';
import Router from 'vue-router';
import VueRouterMetaTags from '@bachdgvn/vue-router-meta-tags';
import Home from './views/Home.vue';
import About from './views/About.vue';

Vue.use(Router);

const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        title: `MyApp - Home Page`,
        metaTags: [
          {
            name: 'description',
            content: `MyApp - The home page of our example app.`,
          },
          {
            property: 'og:description',
            content: `MyApp - The home page of our example app.`,
          },
        ],
      },
    },
    {
      path: '/about',
      name: 'about',
      component: About,
      meta: {
        title: `MyApp - About us`,
        metaTags: [
          {
            name: 'description',
            content: `MyApp - The about page of our example app.`,
          },
          {
            property: 'og:description',
            content: `MyApp - The about page of our example app.`,
          },
        ],
      },
    },
  ],
});

// This callback runs before every route change, including on page load.
router.beforeEach(VueRouterMetaTags.update);

export default router;

Running the tests

npm test

Keywords

FAQs

Package last updated on 16 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc