PC-mj/.output/server/chunks/build/vue.-sixQ7xP-CqaSk6XG.mjs
A1300399510 69bfb3b262 1111
2025-02-20 19:30:25 +08:00

28 lines
818 B
JavaScript

import { ref, watchEffect, watch, getCurrentInstance } from 'vue';
import { L as injectHead, M as resolveUnrefHeadInput } from './server.mjs';
function useHead(input, options = {}) {
const head = options.head || injectHead();
if (head) {
if (!head.ssr)
return clientUseHead(head, input, options);
return head.push(input, options);
}
}
function clientUseHead(head, input, options = {}) {
const deactivated = ref(false);
const resolvedInput = ref({});
watchEffect(() => {
resolvedInput.value = deactivated.value ? {} : resolveUnrefHeadInput(input);
});
const entry = head.push(resolvedInput.value, options);
watch(resolvedInput, (e) => {
entry.patch(e);
});
getCurrentInstance();
return entry;
}
export { useHead as u };
//# sourceMappingURL=vue.-sixQ7xP-CqaSk6XG.mjs.map