@zhead/vue

Use zhead with types for Vue ref's and computed.
1,861 147
Install
npm install @zhead/vue
Latest Version:0.9.9
Vue:2 · 3
License:MIT
Last Updated:Oct 7, 2026
Links: GitHub  ·  npm
Maintainer: harlan_zw

@zhead/vue

A wrapper around zhead for Vue, providing deep reactivity with types for head schema and meta tags packing.

Installation

npm install --save-dev @zhead/vue

# Using yarn
yarn add --dev @zhead/vue

API

defineHead

import { defineHead } from '@zhead/vue'

const title = ref('My Awesome Title')

const head = defineHead({
  title,
  meta: computed(() => {
      return [
        { name: 'description', content: 'My awesome description' },
        { name: 'keywords', content: 'awesome, vue, zhead' },
      ]
  })
})

// {
//   title: 'My Awesome Title',
//   meta: [
//     { name: 'description', content: 'My awesome description' },
//     { name: 'keywords', content: 'awesome, vue, zhead' },
//   ]
// }

packMeta

import { packMeta } from '@zhead/vue'

const description = ref('My Awesome Title')

packMeta([
  { name: 'description', content: description },
])


// Ref<{
//   name: 'description',
//   content: ref('My Awesome Title')
// }>

unpackMeta

import { packMeta } from '@zhead/vue'

const description = ref('My Awesome Title')

unpackmeta({
  description,
})

// Ref<[
//    { name: 'description', content: ref('My Awesome Title') },
// ]>

Related Packages

@zhead/schema-vue

Schema for Vue head reactivity.

279,225 147

Version History

Version Released Vue License
0.9.9 >=2.7 || >=3 MIT
0.9.8 >=2.7 || >=3 MIT
0.9.7 >=2.7 || >=3 MIT
0.9.6 >=2.7 || >=3 MIT
0.9.5 >=2.7 || >=3 MIT