1.0.1 • Published 4 years ago

vie-meta v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Vie-meta is a simple meta and title handler for Vue 3

Vie-Meta uses "Teleport" feature of Vue 3 to handle meta tags.

API

<!-- 
      If value of title is given by vue, 
      document title changes when value changes 
   -->
<vie-meta
   title="Some Title"
   :meta="[
      { name: 'og:title', content: 'nice website' }
   ]"
/>

Setup

import { createApp } from "vue";
import App from "./App.vue";
import VieMeta from "vie-meta";

const app = createApp(App);

app.use(VieMeta);
app.mount();

If you use multiple vie-meta components at once and create different meta tags with same name, you create two meta tags with same name.

<vie-meta
   :meta="[
      { name: 'og:title', content: 'nice website' }
   ]"
/>
<vie-meta
   :meta="[
      { name: 'og:title', content: 'bad website' }
   ]"
/>

<!-- You end up with -->

<head>
   ...
   <meta name="og:title" content="nice website" />
   <meta name="og:title" content="bad website" />
</head>
1.0.1

4 years ago

1.0.0

4 years ago

0.0.5

4 years ago