14 lines
320 B
TypeScript
14 lines
320 B
TypeScript
import { useSSRContext, toValue, type MaybeRefOrGetter } from 'vue';
|
|
|
|
export default function useHead(params: {
|
|
title: MaybeRefOrGetter<string>,
|
|
}) {
|
|
const context = useSSRContext();
|
|
if (context) {
|
|
context.meta ??= {
|
|
title: toValue(params.title),
|
|
meta: {},
|
|
};
|
|
}
|
|
}
|