nuxt-i18n-micro
Version:
Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.
19 lines (18 loc) • 453 B
JavaScript
import { toValue, watch } from "vue";
import { useState } from "#app";
export function useI18nHead(input) {
const pageHead = useState("i18n-head-page", () => null);
const resetPageHead = () => {
pageHead.value = null;
};
if (input !== void 0) {
watch(
() => toValue(input),
(value) => {
pageHead.value = value ?? null;
},
{ immediate: true, deep: true }
);
}
return { pageHead, resetPageHead };
}