unhead-vue-skilld
БесплатноБез исполняемых скриптовНе проверенFull-stack <head> manager for Vue (@unhead/vue 3.x). Use when writing, reviewing, or debugging code that imports @unhead/vue, calls useHead, useSeoMeta…
от skilld-dev★ 188 звёзд на GitHubОб этом скилле
@unhead/vue 3.4.1
Full-stack <head> management for Vue 3. ESM only ("type": "module"), no CJS.
Peer deps: vue >= 3.5.18; optional vite >= 6.4.2, webpack >= 5.0.0 (source: package.json:138-150).
Vue 2: not supported; use @unhead/vue@^1.
Nuxt: Unhead is integrated already; do not install or set it up manually.
Setup (mandatory)
Install @unhead/vue, create the head instance, and register it as a Vue plugin. createHead comes from a subpath export, not the package root.
// entry-client.ts (SPA or hydration)
import { createHead } from '@unhead/vue/client'
import { createApp } from './main'
const { app } = createApp()
const head = createHead()
app.use(head)
app.mount('#app')
// entry-server.ts (SSR)
import { createHead } from '@unhead/vue/server'
import { renderToString } from 'vue/server-renderer'
import { createApp } from './main'
export async function render(url: string) {
const { app } = createApp()
const head = createHead()
app.use(head)
const html = await renderToString(app)
return { html, head } // render tags later with transformHtmlTemplate(head, template)
}
Full SSR template wiring, streaming SSR, Options API, and auto-imports: references/setup.md.
Composables
All imported from @unhead/vue root and used inside setup():
<script setup lang="ts">
import { useHead, useSeoMeta } from '@unhead/vue'
useHead({
title: () => `${user.value.name} - Profile`, // getters, refs, computed all reactive
titleTemplate: '%s | My Site',
meta: [{ name: 'description', content: () => description.value }],
})
useSeoMeta({ // flat, type-safe keys; og/twitter handled automatically
ogTitle: 'My Page',
ogImage: 'https://example.com/image.jpg',
})
</script>
// Third-party scripts
import { useScript } from '@unhead/vue'
const { proxy, onLoaded, status } = useScript(
{ src: 'https://example.com/analytics.js' },
{ use: () => window.analytics, trigger: 'client' },
)
proxy.track('pageview') // queued until the script loads
Details, options tables, and recipes: references/composables.md.
Critical rules
- Async context: calling
useHead()after anawaitinsideonMounted()/watchers throwsuseHead() was called without provide context. Fix, in order of preference: top-levelawaitin<script setup>; declareuseHead()once with refs/computed and update the ref later; captureconst head = injectHead()at setup time and passuseHead(input, { head }). Source: https://unhead.unjs.io/docs/vue/head/guides/core-concepts/reactivity-and-context - Never call
useHead()inside a watcher callback: each call pushes a new entry and duplicates tags. Pass the reactive value into oneuseHead()call instead. - Deduplication key is
key, nothid/vmid:meta: [{ key: 'description', name: 'description', content: '...' }]. - Inline content:
innerHTML(waschildrenin v1); body scripts usetagPosition: 'bodyClose'(wasbody: true). - Untrusted input: use
useHeadSafe(); it whitelists attributes and strips scripts/handlers. - Head instance access in Vue: use
injectHead()from@unhead/vue, notgetActiveHead()fromunhead; only the former binds to component context (e.g.onServerPrefetch).
Deprecated in 3.4.1 (present but slated for removal)
| Export | Status | Replacement |
|---|---|---|
useServerHead, useServerHeadSafe, useServerSeoMeta |
deprecated (dist/index.d.ts:26-30) |
useHead / useHeadSafe / useSeoMeta |
@unhead/vue/legacy (createHead, createServerHead, legacyPlugins) |
deprecated, removed in v4 (dist/legacy.d.ts:14-30) |
@unhead/vue/client / @unhead/vue/server |
resolveUnrefHeadInput |
deprecated (dist/utils.d.ts:9) |
resolveTags(head) from unhead/utils |
unheadVuePlugin from @unhead/vue/stream/vite |
deprecated (dist/stream/vite.d.ts:8) |
Unhead({ streaming: true }).vite() from @unhead/vue/bundler |
MergeHead type |
deprecated (dist/types.d.ts:66) |
generics on VueHeadClient |
Removed in v3 (will not compile): DeprecationsPlugin, setHeadInjectionHandler, createHeadCore, { mode: 'server' | 'client' } entry option, init/dom:renderTag/dom:rendered hooks, headEntries() (use [...head.entries.values()]).
Migration details: references/migration.md.
Export map
| Subpath | Purpose |
|---|---|
@unhead/vue |
composables: useHead, useSeoMeta, useHeadSafe, useScript, injectHead, VueHeadMixin, unheadVueComposablesImports, createUnhead, defineLink, defineScript |
@unhead/vue/client |
createHead() (SPA/hydration), renderDOMHead, VueHeadMixin |
@unhead/vue/server |
createHead() (SSR), renderSSRHead, transformHtmlTemplate, propsToString |
@unhead/vue/components |
<Head> component |
@unhead/vue/plugins |
re-exports unhead/plugins (TemplateParamsPlugin, `AliasSorting |
Установить unhead-vue-skilld в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл unhead-vue-skilld?
Full-stack <head> manager for Vue (@unhead/vue 3.x). Use when writing, reviewing, or debugging code that imports @unhead/vue, calls useHead, useSeoMeta, useHeadSafe, useScript, injectHead, createHead, or sets up Unhead SSR / streaming SSR / build plugins in a Vue app.
Как установить скилл unhead-vue-skilld?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unhead-vue-skilld запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic